Commit 5871d040 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

Fixed a bug in celery state handling

parent 111b4401
......@@ -15,14 +15,16 @@ logger = logging.getLogger(__name__)
def update_submitted_state(sender=None, **kwargs):
def update_submitted_state(sender, headers, **kwargs):
"""Add 'SUBMITTED' state to celery task."""
# the task may not exist if sent using `send_task` which
# sends tasks by name, so fall back to the default result backend
# if that is the case.
task = current_app.tasks.get(sender)
backend = task.backend if task else current_app.backend
backend.store_result(kwargs['headers']['id'], None, "SUBMITTED")
def make_celery(app: Flask) -> Celery:
......@@ -31,7 +31,6 @@ setup(
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment