mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-06 01:58:11 +08:00
Fix async_task timeout parameter handling when cluster timeout is set to None (the default)
The cluster timeout configuration default value None is documented to mean tasks never timeout out. Also the documentation states that the timeout can be overridden for individual tasks. With the old implementation the timeout parameter given to async_task was not honored if the cluster timeout was set to None. Fixes: #335
This commit is contained in:
@@ -247,6 +247,7 @@ def test_enqueue(broker, admin_user):
|
||||
@pytest.mark.parametrize('cluster_config_timeout, async_task_kwargs', (
|
||||
(1, {}),
|
||||
(10, {'timeout': 1}),
|
||||
(None, {'timeout': 1}),
|
||||
))
|
||||
def test_timeout(broker, cluster_config_timeout, async_task_kwargs):
|
||||
# set up the Sentinel
|
||||
@@ -269,6 +270,7 @@ def test_timeout(broker, cluster_config_timeout, async_task_kwargs):
|
||||
(5, {}),
|
||||
(10, {'timeout': 5}),
|
||||
(1, {'timeout': 5}),
|
||||
(None, {'timeout': 5}),
|
||||
))
|
||||
def test_timeout_task_finishes(broker, cluster_config_timeout, async_task_kwargs):
|
||||
# set up the Sentinel
|
||||
|
||||
Reference in New Issue
Block a user