Skip to content

Commit

Permalink
Fix api-umbrella process stop sometimes taking a long time.
Browse files Browse the repository at this point in the history
  • Loading branch information
GUI committed Feb 19, 2017
1 parent 374fa5b commit 837ca8f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/api-umbrella/web-app/config/initializers/delayed_job.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Exit immediately when the delayed_job process receives a kill signal.
#
# This prevents some race conditions that can lead to API Umbrella stopping
# taking a long time. If mongo is running on the same server and mongo exits
# first, then without exiting immediately, delayed_job can get stuck waiting
# for a new mongo primary (until the 30s server_selection_timeout is hit)
# before exiting.
Delayed::Worker.raise_signal_exceptions = true

# Keep failed jobs in the database.
Delayed::Worker.destroy_failed_jobs = false

if(Rails.env.test?)
Expand Down

0 comments on commit 837ca8f

Please sign in to comment.