|
@@ -36,14 +36,16 @@ _task_stack = LocalStack()
|
|
|
|
|
|
def set_default_app(app):
|
|
|
global default_app
|
|
|
- if default_app is None:
|
|
|
- default_app = app
|
|
|
+ default_app = app
|
|
|
|
|
|
|
|
|
def get_current_app():
|
|
|
if default_app is None:
|
|
|
- # creates the default app, but we want to defer that.
|
|
|
- import celery.app # noqa
|
|
|
+ #: creates the global fallback app instance.
|
|
|
+ from celery.app import Celery, default_loader
|
|
|
+ set_default_app(Celery('default', loader=default_loader,
|
|
|
+ set_as_current=False,
|
|
|
+ accept_magic_kwargs=True))
|
|
|
return _tls.current_app or default_app
|
|
|
|
|
|
|