Skip to content

Commit

Permalink
Change pidfile handling, always add index to pidfile name
Browse files Browse the repository at this point in the history
  • Loading branch information
w1mvy committed Oct 27, 2015
1 parent 521ea27 commit a4f508b
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 a4f508b

Please sign in to comment.