Fix tasks.failed error for task that was never started

This commit is contained in:
allegroai 2021-01-05 19:01:43 +02:00
parent e6c0f1b6d8
commit d7ddfde26e

View File

@ -129,6 +129,8 @@ def set_task_status_from_call(
):
fields_resolver.add_fields(
duration=int((task.started - datetime.utcnow()).total_seconds())
if task.started
else 0
)
status_reason = request.status_reason