diff --git a/lib/capistrano/tasks/capistrano2.rb b/lib/capistrano/tasks/capistrano2.rb index 55861e2..9701b7c 100644 --- a/lib/capistrano/tasks/capistrano2.rb +++ b/lib/capistrano/tasks/capistrano2.rb @@ -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 diff --git a/lib/capistrano/tasks/sidekiq.rake b/lib/capistrano/tasks/sidekiq.rake index 0954b04..b975e31 100644 --- a/lib/capistrano/tasks/sidekiq.rake +++ b/lib/capistrano/tasks/sidekiq.rake @@ -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