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

Commit

Permalink
Set RACK_ENV as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaniwaki committed Apr 14, 2015
1 parent f7dec5a commit fae9a65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/capistrano-resque/capistrano_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def status_command
end

def start_command(queue, pid)
"cd #{current_path} && RAILS_ENV=#{rails_env} QUEUE=\"#{queue}\" \
"cd #{current_path} && RACK_ENV=#{rails_env} RAILS_ENV=#{rails_env} QUEUE=\"#{queue}\" \
PIDFILE=#{pid} BACKGROUND=yes \
#{"VERBOSE=1 " if fetch(:resque_verbose)}\
INTERVAL=#{interval} \
Expand Down Expand Up @@ -77,7 +77,7 @@ def status_scheduler
end

def start_scheduler(pid)
"cd #{current_path} && RAILS_ENV=#{rails_env} \
"cd #{current_path} && RACK_ENV=#{rails_env} RAILS_ENV=#{rails_env} \
PIDFILE=#{pid} BACKGROUND=yes \
#{"VERBOSE=1 " if fetch(:resque_verbose)}\
MUTE=1 \
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]} 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]} 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]} 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 :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}}
end
end
end
Expand Down

0 comments on commit fae9a65

Please sign in to comment.