Fix the queue item delete.
This commit is contained in:
parent
d6e14f170c
commit
0a6322015c
2 changed files with 2 additions and 7 deletions
|
@ -213,8 +213,7 @@ class WorkQueue(object):
|
|||
|
||||
def cancel(self, item_id):
|
||||
""" Attempts to cancel the queue item with the given ID from the queue. Returns true on success
|
||||
and false if the queue item could not be canceled. A queue item can only be canceled if
|
||||
if is available and has retries remaining.
|
||||
and false if the queue item could not be canceled.
|
||||
"""
|
||||
|
||||
with self._transaction_factory(db):
|
||||
|
@ -225,10 +224,6 @@ class WorkQueue(object):
|
|||
except QueueItem.DoesNotExist:
|
||||
return False
|
||||
|
||||
# Check the queue item.
|
||||
if not queue_item.available or queue_item.retries_remaining == 0:
|
||||
return False
|
||||
|
||||
# Delete the queue item.
|
||||
queue_item.delete_instance(recursive=True)
|
||||
return True
|
||||
|
|
Reference in a new issue