I am trying to change the timeout on an rq job but nothing seems to work. I've got something to the effect of:
my_queue = Queue('my_task', connection=Redis())
job_args = (1, 2, 4)
my_queue.enqueue_call(
my_func,
args=job_args,
timeout=2700
)
but I'm still getting
JobTimeoutException: Job exceeded maximum timeout value (180 seconds)
I've got so desperate I even tried going into the rq module queue.py and changing the default argument for timeout to 2700 and DEFAULT_TIMEOUT (variable defined in the Queue class, which contains the enqueue_call method). Am I missing something or is there an issue with this anyone knows about? Thanks!
We can tackle this by setting the timeout at Queue initialization.
from rq import Worker, Queue, Connection
q = Queue(default_timeout=3600)
Hope this will solve your query.
Use
my_queue = Queue('my_task', connection=Redis())
job_args = [1, 2, 4]
my_queue.enqueue_call(
f=my_func,
job_timeout=2700,
args=job_args
)
timeout is not the correct parameter name. Check "parse_args" function for all other parameter names in queue.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With