mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-08 03:38: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:
@@ -59,6 +59,13 @@ timeout
|
||||
The number of seconds a worker is allowed to spend on a task before it's terminated. Defaults to ``None``, meaning it will never time out.
|
||||
Set this to something that makes sense for your project. Can be overridden for individual tasks.
|
||||
|
||||
.. _ack_failures:
|
||||
|
||||
ack_failures
|
||||
~~~~~~~~~~~~
|
||||
|
||||
When set to ``True``, also acknowledge unsuccessful tasks. This causes failed tasks to be considered as successful deliveries, thereby removing them from the task queue. Can also be set per-task by passing the ``ack_failure`` option to :func:`async`. Defaults to ``False``.
|
||||
|
||||
.. _retry:
|
||||
|
||||
retry
|
||||
|
||||
Reference in New Issue
Block a user