Skip to content
Snippets Groups Projects
Verified Commit a7fc15ef authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix celery_optional (register tasks correctly)

parent 573f3d12
No related branches found
No related tags found
1 merge request!209Fix celery config
......@@ -116,11 +116,12 @@ def celery_optional(orig: Callable) -> Callable:
and it is executed synchronously.
"""
if hasattr(settings, "CELERY_RESULT_BACKEND"):
from ..celery import app # noqa
task = app.task(orig)
def wrapped(*args, **kwargs):
if hasattr(settings, "CELERY_RESULT_BACKEND"):
from ..celery import app # noqa
task = app.task(orig)
task.delay(*args, **kwargs)
else:
orig(*args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment