I'm using the following command to start 2 Resque background workers from my CLI.
COUNT=2 QUEUE=* rake resque:workers RAILS_ENV=production &
When I pull code updates from git to the server, I have to kill the background workers and rerun the command. I typically do something like this:
ps -u myuser # this shows me the process I started originally with the ids
kill -9 12345
kill -9 23456
Is there a way to kill these background workers from the Resque gem? I would like to create a rake task or a module in Ruby that would allow me to kill and restart these workers.
rake
tasks are there?rake -T
can help explain. – tadmanrake resque:failures:sort
,rake resque:work
,rake resque:workers
but none allow me to stop a worker. @tadman – Cannon Moyersystemd
config to make it as easy assystemctl start
andsystemctl stop
etc. That makes managing it on a production server a lot easier, especially as now you can check up on the worker status, too, plus log output gets automatically bridged tojournalctl
if your system uses that. – tadman