Dispatcharr/dispatcharr/__init__.py
SergeantPanda d93cb6265f refactor: Eagerly import celery_app to ensure proper configuration in production
Updated the import mechanism for celery_app to avoid issues with lazy-loading, ensuring the default Celery app is correctly configured in production environments. Removed the __getattr__ function for celery_app, simplifying the module structure.
2026-07-08 13:11:17 +00:00

9 lines
367 B
Python

# dispatcharr/__init__.py
# For Celery: import eagerly so @shared_task binds to the configured app.
# Lazy-loading via __getattr__ left the default Celery app unconfigured in
# production (no CELERY_BROKER_URL in env), so .delay() fell back to AMQP
# localhost and failed with ConnectionRefusedError.
from .celery import app as celery_app
__all__ = ("celery_app",)