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

Merge pull request #1476 from dballona/remove-daemonization-for-jruby

Remove daemonization for JRuby
This commit is contained in:
Mike Perham 2014-02-11 15:04:46 -08:00
commit b6dc5ba220

View file

@ -91,10 +91,19 @@ namespace :sidekiq do
rails_env = fetch(:rails_env, "production")
within current_path do
for_each_process do |pid_file, idx|
if fetch(:sidekiq_cmd)
execute fetch(:sidekiq_cmd), "-d -i #{idx} -P #{pid_full_path(pid_file)} #{fetch(:sidekiq_options)}"
if !defined? JRUBY_VERSION
if fetch(:sidekiq_cmd)
execute fetch(:sidekiq_cmd), "-d -i #{idx} -P #{pid_full_path(pid_file)} #{fetch(:sidekiq_options)}"
else
execute :bundle, :exec, :sidekiq, "-d -i #{idx} -P #{pid_full_path(pid_file)} #{fetch(:sidekiq_options)}"
end
else
execute :bundle, :exec, :sidekiq, "-d -i #{idx} -P #{pid_full_path(pid_file)} #{fetch(:sidekiq_options)}"
execute "echo 'Since JRuby doesn't support Process.daemon, Sidekiq will be running without the -d flag."
if fetch(:sidekiq_cmd)
execute fetch(:sidekiq_cmd), "-i #{idx} -P #{pid_full_path(pid_file)} #{fetch(:sidekiq_options)} >/dev/null 2>&1 &"
else
execute :bundle, :exec, :sidekiq, "-i #{idx} -P #{pid_full_path(pid_file)} #{fetch(:sidekiq_options)} >/dev/null 2>&1 &"
end
end
end
end