Make the worker post json. Add a retry timeout after an incompletel queue item is processed. Submit webhook jobs to the queue on a successful push.
This commit is contained in:
parent
f55e4074e0
commit
e787d8b2d8
4 changed files with 31 additions and 4 deletions
|
@ -56,7 +56,9 @@ class WorkQueue(object):
|
|||
def complete(self, completed_item):
|
||||
completed_item.delete_instance()
|
||||
|
||||
def incomplete(self, incomplete_item):
|
||||
def incomplete(self, incomplete_item, retry_after=300):
|
||||
retry_date = datetime.now() + timedelta(seconds=retry_after)
|
||||
incomplete_item.available_after = retry_date
|
||||
incomplete_item.available = True
|
||||
incomplete_item.save()
|
||||
|
||||
|
|
Reference in a new issue