mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-09 05:48:11 +08:00
Add option for acknowledging failed tasks (globally and per-task)
If a task fails with an exception, it is retried until it succeeds. This is contrary to what is said in the documentation: under the "Architecture" section, heading "Broker" it says that even when a task errors, it's still considered a successful delivery. Failed tasks never get acknowledged however, thereby being retried after the timeout period. See also issues #238 and #194. This patch adds an option to acknowledge failures, thereby closing issue #238. Issue #194 would require some more work. The default of this option is set to `False`, thereby maintaining backwards compatibility.
This commit is contained in:
@@ -110,6 +110,11 @@ class Conf(object):
|
||||
# Number of seconds to wait for a worker to finish.
|
||||
TIMEOUT = conf.get('timeout', None)
|
||||
|
||||
# Whether to acknowledge unsuccessful tasks.
|
||||
# This causes failed tasks to be considered delivered, thereby removing them from
|
||||
# the task queue. Defaults to False.
|
||||
ACK_FAILURES = conf.get('ack_failures', False)
|
||||
|
||||
# Number of seconds to wait for acknowledgement before retrying a task
|
||||
# Only works with brokers that guarantee delivery. Defaults to 60 seconds.
|
||||
RETRY = conf.get('retry', 60)
|
||||
|
||||
Reference in New Issue
Block a user