Trying to find a good way to catch a timeout of an RQ job, so it can be requeued after the timeout.
Basically, the correct solution would provide a way (for example, an exception handler in the worker or something of the sort) to requeue the job that timed out. Also, if the job goes back to the failed
queue, that's a good answer too.
Thanks very much! Any help will be appreciated!
Sounds like you want to use exception handling. From the docs:
You could also store jobs in a redis sorted set with job_id as key and
time.time() + timeout
as score, and then have a worker runZRANGEBYSCORE sorted_set 0 [current_time]
and process whatever's returned as a timed-out job.