Worker tasks are registered per app
CI / validate-monitoring (push) Successful in 8s
CI / lint (push) Successful in 10s
CI / test (push) Successful in 1m46s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s

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
This commit is contained in:
mattandClaude Opus 5.5 committed 2026-09-25 21:24:41 +01:00
1 parent d49aa72be1
commit c1a7dd0877
5 files changed
+56 -25

No files matched your search

+1 -1
View File
@@ -167,7 +167,7 @@ def test_nothing_is_registered_when_federation_is_off(app):
assert views == []
for signal in (events.scrobbles_stored, events.now_playing_changed, events.import_finished):
assert not any(_from_federation(r) for r in signal.receivers_for(None))
assert not any(name.startswith("federation") for name in worker.registered())
assert not any(name.startswith("federation") for name in worker.registered(app))
class _Enabled(TestConfig):