Skip to content

Commit

Permalink
Merge pull request #5146 from consul/delayed_job_monitor
Browse files Browse the repository at this point in the history
Restart DelayedJob workers after they crash
  • Loading branch information
javierm committed Jun 30, 2023
2 parents 37417e5 + ee9cd88 commit db4db07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/deploy.rb
Expand Up @@ -40,6 +40,7 @@ def main_deploy_server

set :delayed_job_workers, 2
set :delayed_job_roles, :background
set :delayed_job_monitor, true

set :whenever_roles, -> { :app }

Expand Down
2 changes: 1 addition & 1 deletion config/schedule.rb
Expand Up @@ -42,5 +42,5 @@
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

0 comments on commit db4db07

Please sign in to comment.