mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-04 08:18:12 +08:00
Merge pull request #298 from Balletie/master
Add option for acknowledging failed tasks (globally and per-task)
This commit is contained in:
+5
-5
@@ -324,12 +324,12 @@ def monitor(result_queue, broker=None):
|
||||
save_cached(task, broker)
|
||||
else:
|
||||
save_task(task, broker)
|
||||
# acknowledge and log the result
|
||||
# acknowledge result
|
||||
ack_id = task.pop('ack_id', False)
|
||||
if ack_id and (task['success'] or task.get('ack_failure', False)):
|
||||
broker.acknowledge(ack_id)
|
||||
# log the result
|
||||
if task['success']:
|
||||
# acknowledge
|
||||
ack_id = task.pop('ack_id', False)
|
||||
if ack_id:
|
||||
broker.acknowledge(ack_id)
|
||||
# log success
|
||||
logger.info(_("Processed [{}]").format(task['name']))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user