Fix timeout override

Closes https://github.com/Koed00/django-q/issues/332
This commit is contained in:
Bart Nagel
2019-01-21 16:23:45 -08:00
parent 7ffb3e4da2
commit 4c2a2f3279
2 changed files with 2 additions and 2 deletions

View File

@@ -368,7 +368,7 @@ def worker(task_queue, result_queue, timer, timeout=Conf.TIMEOUT):
# We're still going
if not result:
db.close_old_connections()
timer_value = task['kwargs'].pop('timeout', timeout or 0)
timer_value = task.pop('timeout', timeout or 0)
# signal execution
pre_execute.send(sender="django_q", func=f, task=task)
# execute the payload

View File

@@ -22,7 +22,7 @@ def async_task(func, *args, **kwargs):
"""Queue a task for the cluster."""
keywords = kwargs.copy()
opt_keys = (
'hook', 'group', 'save', 'sync', 'cached', 'ack_failure', 'iter_count', 'iter_cached', 'chain', 'broker')
'hook', 'group', 'save', 'sync', 'cached', 'ack_failure', 'iter_count', 'iter_cached', 'chain', 'broker', 'timeout')
q_options = keywords.pop('q_options', {})
# get an id
tag = uuid()