symfonic.diagnostics.checks.check_consolidate_schedule¶
check_consolidate_schedule ¶
Consolidate-beat-schedule audit (v7.16, item 5).
Detects the hardcoded "default" tenant trap in the adopter's
Celery beat schedule. Scaffolded projects ship with::
"consolidate-memory-default": {
"task": "<pkg>.tasks.consolidate_memory_task",
"schedule": crontab(hour=3, minute=0),
"args": ("__all__",),
}
A common edit -- copy-pasted from older guides -- changes "__all__"
to "default", which silently restricts nightly consolidation to a
single tenant. Multi-tenant adopters then watch their consolidation
metrics flatline.
Detection strategy: runtime introspection of any registered Celery app.
- Try the conventional
app.workerimport path. - Fall back to scanning
sys.modulesfor any module exposing a :class:celery.Celeryinstance. - If no Celery is in play, skip silently -- not every adopter uses Celery, and we don't want to flag a check that doesn't apply.
For each beat entry, inspect the args tuple; if any element is the
literal string "default", emit a WARN. We deliberately avoid
clever schema inference -- adopters with non-default args shapes
are responsible for their own audit.
check_consolidate_schedule
async
¶
Audit the Celery beat schedule for the hardcoded-tenant trap.