Closed earnaway closed 8 years ago
AFIAK there is no recommended way. I used to kill php cli , that used to kill the workers.
Check the signals section of the docs. One of the signals instructs the worker to shut down after finishing the current job. This is the recommended way to stop a worker, as you don't have any incomplete jobs left behind this way.
Thanks, I tried sending signals to the process and that works just as I wanted. Cheers.
Apologies for providing wrong information :(
It wasn't wrong. Just wasn't the specific signal they were looking for. :)
No worries @rajibahmed, that'll still work under some conditions, but could create issues in other situations. Since I'm using supervisor, I could just send a signal to terminate as @danhunsaker mentioned, and supervisor will cause a new process worker to start up, which solved my question :)
Is there a recommended way to restart the workers for long running workers? I'm using supervisor to start my resque workers, and I could just kill all the processes and let supervisor start them again, but wondering if there was any recommended way to restart the workers to pick up any code changes that I've made for example.