Skip to content

Commit

Permalink
Fix PENDING in state after celery task is removed from redis
Browse files Browse the repository at this point in the history
  • Loading branch information
jirik committed Dec 23, 2019
1 parent 5d981f4 commit 95fb2da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/layman/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ def abort_task_chain__deprecated(results_by_order, results_by_name=None):


def is_task_successful(task_info):
return task_info['last'].successful()
return task_info['last'].successful() or task_info['finished'] is True


def is_task_failed(task_info):
return any(tr.failed() for tr in task_info['by_order'])


def is_task_ready(task_info):
return is_task_successful(task_info) or is_task_failed(task_info) or task_info['finished'] is True
return is_task_successful(task_info) or is_task_failed(task_info)


def _get_publication_hash(username, publication_type, publication_name):
Expand Down

0 comments on commit 95fb2da

Please sign in to comment.