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

Resque TERM_CHILD setting #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion lib/capistrano-resque/tasks/capistrano-resque.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace :load do
set :resque_verbose, true
set :resque_pid_path, -> { File.join(shared_path, 'tmp', 'pids') }
set :resque_dynamic_schedule, false
set :term_child, false # http://hone.herokuapp.com/resque/2012/08/21/resque-signals.html
end
end

Expand Down Expand Up @@ -70,7 +71,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]} 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 :nohup, %{#{SSHKit.config.command_map[:rake]} RAILS_ENV=#{rails_env} QUEUE="#{queue}" PIDFILE=#{pid} BACKGROUND=yes #{"TERM_CHILD=1 " if fetch(:term_child)} #{"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