1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

task wasn't dropping pid file, use current_path everywhere.

This commit is contained in:
Matthew Ford 2012-03-09 23:17:20 +00:00
parent 8cc67fd6d8
commit d434e035e4

View file

@ -8,18 +8,18 @@ Capistrano::Configuration.instance.load do
desc "Quiet sidekiq (stop accepting new work)"
task :quiet do
run "cd #{current_path} && kill -USR1 `cat tmp/pids/sidekiq.pid`"
run "cd #{current_path} && kill -USR1 `cat #{current_path}/tmp/pids/sidekiq.pid`"
end
desc "Stop sidekiq"
task :stop do
run "cd #{current_path} && kill `cat tmp/pids/sidekiq.pid` && sleep #{fetch :sidekiq_timeout} && kill -9 `cat tmp/pids/sidekiq.pid` && rm tmp/pids/sidekiq.pid"
run "cd #{current_path} && kill `cat #{current_path}/tmp/pids/sidekiq.pid` && sleep #{fetch :sidekiq_timeout} && kill -9 `cat #{current_path}/tmp/pids/sidekiq.pid` && rm #{current_path}/tmp/pids/sidekiq.pid"
end
desc "Start sidekiq"
task :start do
rails_env = fetch(:rails_env, "production")
run "cd #{current_path} && nohup bundle exec sidekiq -e #{rails_env} -C config/sidekiq.yml -P tmp/pids/sidekiq.pid >> #{current_path}/log/sidekiq.log &"
run "cd #{current_path} && nohup bundle exec sidekiq -e #{rails_env} -C #{current_path}/config/sidekiq.yml -P #{current_path}/tmp/pids/sidekiq.pid >> #{current_path}/log/sidekiq.log &"
end
desc "Restart sidekiq"