rq / django-rq

A simple app that provides django integration for RQ (Redis Queue)
MIT License
1.81k stars 286 forks source link

Feature to support graceful timeout #585

Open Salaah01 opened 1 year ago

Salaah01 commented 1 year ago

Let's suppose a context manager exists inside a function which is being run as part of the job. If the job times out, the cleanup __exit__ code isn't executed and the entire job is killed.

Can I request a feature where we have a graceful_timeout parameter as well as a timeout parameter. The idea being that graceful_timeout causes an normal interruption whereas the timeout continues to completely kill the program.

That will then give the program time to run some clean up code.

selwin commented 1 year ago

I'd love to have this feature if it can be implemented in a clean way. This would need to be implemented in RQ first though. Mind opening an issue http://github.com/rq/rq ?