lib/capistrano/tasks/capistrano2.rb in capistrano-sidekiq-0.3.3 vs lib/capistrano/tasks/capistrano2.rb in capistrano-sidekiq-0.3.4
- old
+ new
@@ -55,10 +55,10 @@
logger.info 'Since JRuby doesn\'t support Process.daemon, Sidekiq will not be running as a daemon.'
else
args.push '--daemon'
end
- run "cd #{current_path} ; #{fetch(:sidekiq_cmd)} #{args.compact.join(' ')} ", pty: false
+ run "if [ -d #{current_path} ] && [ ! -f #{pid_file} ]; then cd #{current_path} ; #{fetch(:sidekiq_cmd)} #{args.compact.join(' ')} ; else echo 'Sidekiq is already running'; fi", pty: false
end
desc 'Quiet sidekiq (stop accepting new work)'
task :quiet, roles: lambda { fetch(:sidekiq_role) }, on_no_matching_servers: :continue do
for_each_process do |pid_file, idx|