The task registry was module-global, so tasks registered by an app with
federation enabled would also run under an app without it (and break
the "federation off registers nothing" guarantee depending on order).
Tasks now live on each app (app.extensions["worker_tasks"]);
register_task/register_periodic take the app, and the worker runs the
current app's tasks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
scrobbler/worker.py runs tasks that modules register: queue tasks
(called while they report work) and periodic tasks. A failing task is
logged, counted, rolled back and doesn't stop the others. Imports are
now just a registered task plus a periodic stall check.
- `flask worker` replaces `flask imports worker` (kept as an alias);
compose uses the new command
- scrobbler_worker_tasks_total{task,outcome} and a Worker tasks panel
on the Usage dashboard
- WORKER_METRICS_PORT (IMPORT_WORKER_METRICS_PORT still honoured)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW