rq / django-rq

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

How to stop/terminate a long-running job. Deleting the job doesn't do the trick #573

Open gabriels1234 opened 1 year ago

gabriels1234 commented 1 year ago

Hi,

I was wondering if django-rq provides a way to "terminate" a running job. For Jobs that take hours, deleting the job would not make the trick. or is it that it's a limitation from RQ?

Thanks!

gabriels1234 commented 1 year ago

Any guesses? @selwin Should I investigate and try to make it happen if possible? (i.e adding an option to "stop/terminate" a job?)

selwin commented 1 year ago

@gabriels1234 sorry I just saw this. RQ actually provides a way to stop a job that's currently executing. https://python-rq.org/docs/jobs/#stopping-a-currently-executing-job

My advice would be to add a button to send a stop job command in job/worker detail page.