Skip to content

Commit

Permalink
Ensure checking task status doesn't unecessarily raise an exception (s…
Browse files Browse the repository at this point in the history
…potify#52)

Based of off Netflix@b8d1b95 as we saw the same issue internally
  • Loading branch information
alexnsu authored Jan 13, 2022
1 parent 7caaaa5 commit e1859f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lemur/common/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def is_task_active(fun, task_id, args):

i = inspect()
active_tasks = i.active()

if active_tasks is None:
return False

for _, tasks in active_tasks.items():
for task in tasks:
if task.get("id") == task_id:
Expand Down

0 comments on commit e1859f0

Please sign in to comment.