add attempt_count to task

This commit is contained in:
Tim O'Meara
2020-08-11 10:16:31 -05:00
parent 07d0a8c0d1
commit 3c3395f24b
3 changed files with 9 additions and 0 deletions
+5
View File
@@ -478,7 +478,12 @@ def save_task(task, broker: Broker):
existing_task.stopped = task["stopped"]
existing_task.result = task["result"]
existing_task.success = task["success"]
existing_task.attempt_count = existing_task.attempt_count + 1
existing_task.save()
if 0 < Conf.ATTEMPT_COUNT == existing_task.attempt_count:
broker.acknowledge(task['ack_id'])
else:
Task.objects.create(
id=task["id"],