Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Make "nohup" non-default optional to addres #103

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/capistrano-resque/capistrano_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def start_command(queue, pid)
PIDFILE=#{pid} BACKGROUND=yes \
#{"VERBOSE=1 " if fetch(:resque_verbose)}\
INTERVAL=#{interval} \
nohup #{fetch(:bundle_cmd, "bundle")} exec rake \
#{fetch(:nohup_cmd, "")} #{fetch(:bundle_cmd, "bundle")} exec rake \
#{"environment " if fetch(:resque_environment_task)}\
resque:work #{output_redirection}"
end
Expand Down Expand Up @@ -82,7 +82,7 @@ def start_scheduler(pid)
#{"VERBOSE=1 " if fetch(:resque_verbose)}\
MUTE=1 \
#{"DYNAMIC_SCHEDULE=yes " if fetch(:resque_dynamic_schedule)}\
nohup #{fetch(:bundle_cmd, "bundle")} exec rake \
#{fetch(:nohup_cmd, "")} #{fetch(:bundle_cmd, "bundle")} exec rake \
#{"environment " if fetch(:resque_environment_task)}\
resque:scheduler #{output_redirection}"
end
Expand Down
4 changes: 2 additions & 2 deletions lib/capistrano-resque/tasks/capistrano-resque.rake
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace :resque do
number_of_workers.times do
pid = "#{fetch(:resque_pid_path)}/resque_work_#{worker_id}.pid"
within current_path do
execute :nohup, %{#{SSHKit.config.command_map[:rake]} RACK_ENV=#{rails_env} RAILS_ENV=#{rails_env} QUEUE="#{queue}" PIDFILE=#{pid} BACKGROUND=yes #{"VERBOSE=1 " if fetch(:resque_verbose)}INTERVAL=#{fetch(:interval)} #{"environment " if fetch(:resque_environment_task)}resque:work #{output_redirection}}
execute %{cd #{release_path} && #{SSHKit.config.command_map[:rake]} RACK_ENV=#{rails_env} RAILS_ENV=#{rails_env} QUEUE="#{queue}" PIDFILE=#{pid} BACKGROUND=yes #{"VERBOSE=1 " if fetch(:resque_verbose)}INTERVAL=#{fetch(:interval)} #{"environment " if fetch(:resque_environment_task)}resque:work #{output_redirection}}
end
worker_id += 1
end
Expand Down Expand Up @@ -130,7 +130,7 @@ namespace :resque do
create_pid_path
pid = "#{fetch(:resque_pid_path)}/scheduler.pid"
within current_path do
execute :nohup, %{#{SSHKit.config.command_map[:rake]} RACK_ENV=#{rails_env} RAILS_ENV=#{rails_env} PIDFILE=#{pid} BACKGROUND=yes #{"VERBOSE=1 " if fetch(:resque_verbose)}MUTE=1 #{"DYNAMIC_SCHEDULE=yes " if fetch(:resque_dynamic_schedule)}#{"environment " if fetch(:resque_environment_task)}resque:scheduler #{output_redirection}}
execute %{cd #{release_path} && #{SSHKit.config.command_map[:rake]} RACK_ENV=#{rails_env} RAILS_ENV=#{rails_env} PIDFILE=#{pid} BACKGROUND=yes #{"VERBOSE=1 " if fetch(:resque_verbose)}MUTE=1 #{"DYNAMIC_SCHEDULE=yes " if fetch(:resque_dynamic_schedule)}#{"environment " if fetch(:resque_environment_task)}resque:scheduler #{output_redirection}}
end
end
end
Expand Down