Merge pull request #5146 from consul/delayed_job_monitor
Restart DelayedJob workers after they crash
This commit is contained in:
@@ -40,6 +40,7 @@ set :puma_conf, "#{release_path}/config/puma/#{fetch(:rails_env)}.rb"
|
||||
|
||||
set :delayed_job_workers, 2
|
||||
set :delayed_job_roles, :background
|
||||
set :delayed_job_monitor, true
|
||||
|
||||
set :whenever_roles, -> { :app }
|
||||
|
||||
|
||||
@@ -42,5 +42,5 @@ end
|
||||
every :reboot do
|
||||
command "cd #{@path} && bundle exec puma -C config/puma/#{@environment}.rb"
|
||||
# Number of workers must be kept in sync with capistrano's delayed_job_workers
|
||||
command "cd #{@path} && RAILS_ENV=#{@environment} bin/delayed_job -n 2 restart"
|
||||
command "cd #{@path} && RAILS_ENV=#{@environment} bin/delayed_job -m -n 2 restart"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user