mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-05 05:18:12 +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:
@@ -54,6 +54,10 @@ timeout
|
||||
"""""""
|
||||
Overrides the cluster's timeout setting for this task.
|
||||
|
||||
ack_failure
|
||||
"""""""""""
|
||||
Overrides the cluster's :ref:`ack_failures` setting for this task.
|
||||
|
||||
sync
|
||||
""""
|
||||
Simulates a task execution synchronously. Useful for testing.
|
||||
@@ -244,6 +248,7 @@ Reference
|
||||
:param str group: An optional group identifier
|
||||
:param int timeout: Overrides global cluster :ref:`timeout`.
|
||||
:param bool save: Overrides global save setting for this task.
|
||||
:param bool ack_failure: Overrides the global :ref:`ack_failures` setting for this task.
|
||||
:param bool sync: If set to True, async will simulate a task execution
|
||||
:param cached: Output the result to the cache backend. Bool or timeout in seconds
|
||||
:param broker: Optional broker connection from :func:`brokers.get_broker`
|
||||
|
||||
Reference in New Issue
Block a user