refactor: Lazy load celery_app in __getattr__ to improve module attribute access and reduce initial import overhead.

This commit is contained in:
SergeantPanda 2026-07-07 21:33:49 +00:00
parent b26916dc7c
commit 8b22f1c63a

View file

@ -1,6 +1,11 @@
# dispatcharr/__init__.py
# For Celery:
from .celery import app as celery_app
__all__ = ("celery_app",)
def __getattr__(name: str):
if name == "celery_app":
from .celery import app as celery_app
return celery_app
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")