Rails: How to restart sidekiq?

Can Can picture Can Can · Jun 27, 2014 · Viewed 38.4k times · Source

I am using sidekiq gem to run API calls in background. I ran sidekiq in Daemon process like:

  bundle exec sidekiq -d

Now I made some changes in my method, so I want to restart sidekiq. I tried to kill the sidekiq by using the below command:

  kill -9 process_id 

but it's not working. I want to know the command to restart sidekiq process. If you have any idea please share with me.

I tried the below command also:

 sidekiqctl stop /path/to/pid file/pids/sidekiq.pid

Answer

hlcs picture hlcs · Apr 17, 2016

Start:

$ bundle exec sidekiq -d -P tmp/sidekiq.pid -L log/sidekiq.log 

where -d demonize, -P pid file, -L log file.

Stop:

$ bundle exec sidekiqctl stop tmp/sidekiq.pid 0
Sidekiq shut down gracefully.

where 0 is number of seconds to wait until Sidekiq exits.