From 4c2a2f32793c340b815a99d3823f85299347468c Mon Sep 17 00:00:00 2001 From: Bart Nagel Date: Mon, 21 Jan 2019 16:23:45 -0800 Subject: [PATCH] Fix timeout override Closes https://github.com/Koed00/django-q/issues/332 --- django_q/cluster.py | 2 +- django_q/tasks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django_q/cluster.py b/django_q/cluster.py index dc1b46c..c330e75 100644 --- a/django_q/cluster.py +++ b/django_q/cluster.py @@ -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 diff --git a/django_q/tasks.py b/django_q/tasks.py index 4769c3d..a4abbc9 100644 --- a/django_q/tasks.py +++ b/django_q/tasks.py @@ -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()