Skip to content

Commit

Permalink
Merge pull request #116 from w1mvy/fix_pidfile_handling
Browse files Browse the repository at this point in the history
Change pidfile handling, always add index to pidfile name
  • Loading branch information
seuros committed Oct 27, 2015
2 parents 521ea27 + a4f508b commit 71a4278
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions lib/capistrano/tasks/capistrano2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@
def for_each_process(sidekiq_role, &block)
sidekiq_processes = fetch(:"#{ sidekiq_role }_processes") rescue 1
sidekiq_processes.times do |idx|
if idx.zero? && sidekiq_processes <= 1
pid_file = fetch(:sidekiq_pid)
else
pid_file = fetch(:sidekiq_pid).gsub(/\.pid$/, "-#{idx}.pid")
end
pid_file = fetch(:sidekiq_pid).gsub(/\.pid$/, "-#{idx}.pid")
yield(pid_file, idx)
end
end
Expand Down
4 changes: 1 addition & 3 deletions lib/capistrano/tasks/sidekiq.rake
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ namespace :sidekiq do
next unless host.roles.include?(role)
processes = fetch(:"#{ role }_processes") || fetch(:sidekiq_processes)
processes.times do |idx|
pids.push (idx.zero? && processes <= 1) ?
fetch(:sidekiq_pid) :
fetch(:sidekiq_pid).gsub(/\.pid$/, "-#{idx}.pid")
pids.push fetch(:sidekiq_pid).gsub(/\.pid$/, "-#{idx}.pid")
end
end

Expand Down

0 comments on commit 71a4278

Please sign in to comment.