Reputation: 48555
I'm having a rough time here with Resque, firstly, in development when running rake resque:work QUEUE='*'
to work on the queue it starts up fine and starts running the perform
method for my workers, which is fine; the problem is that the workers don't seem to run my new application code, say I update the perform
method in that worker then Ctrl+c out of that rake resque:work QUEUE='*'
process and starting it up again, whilst queuing new jobs to be worked on doesn't result in the worker running with the new updated code.
So mainly my problem here is, how do I safely kill the resque:work
task and restart my workers with the new application code?
Upvotes: 0
Views: 1854
Reputation: 15530
Resque workers respond to a few different signals:
QUIT - Wait for child to finish processing then exit
TERM / INT - Immediately kill child then exit
USR1 - Immediately kill child but don't exit
USR2 - Don't start to process any new jobs
CONT - Start to process new jobs again after a USR2
If you want to gracefully shutdown a Resque worker, use QUIT.
kill -s QUIT reqsue.pid
if you want to setup resque restart with capitrano, use this gits
Upvotes: 4