feat(scheduler): admin dashboard endpoint + per-job activity tracking

Record each scheduler job's run activity in-process (running / last result /
error / timestamps) and expose a snapshot. New admin-only GET
/api/admin/scheduler returns the per-job activity (with APScheduler next-run
times), the DB-derived work still queued (channels/videos pending, deep ETA,
live-refresh backlog) and the shared quota picture.
This commit is contained in:
npeter83 2026-06-16 14:38:51 +02:00
parent e6c53b3f96
commit a339a73bd6
3 changed files with 177 additions and 2 deletions

View file

@ -26,7 +26,19 @@ from starlette.middleware.sessions import SessionMiddleware
from app import auth
from app.config import settings
from app.routes import admin, channels, feed, health, me, playlists, quota, sync, tags, version
from app.routes import (
admin,
channels,
feed,
health,
me,
playlists,
quota,
scheduler as scheduler_routes,
sync,
tags,
version,
)
from app.scheduler import shutdown_scheduler, start_scheduler
@ -68,6 +80,7 @@ app.include_router(me.router)
app.include_router(channels.router)
app.include_router(playlists.router)
app.include_router(admin.router)
app.include_router(scheduler_routes.router)
app.include_router(quota.router)
app.include_router(version.router)