Merge pull request #931 from cantino/reduce_default_delayed_job_max_runtime

Reduce the default DELAYED_JOB_MAX_RUNTIME from 20 minutes to 2 minutes.

Andrew Cantino 9 years ago
parent
commit
8c6a090640
2 changed files with 2 additions and 2 deletions
  1. 1 1
      .env.example
  2. 1 1
      config/initializers/delayed_job.rb

+ 1 - 1
.env.example

@@ -167,7 +167,7 @@ TIMEZONE="Pacific Time (US & Canada)"
167 167
 FAILED_JOBS_TO_KEEP=100
168 168
 
169 169
 # Maximum runtime of background jobs in minutes
170
-DELAYED_JOB_MAX_RUNTIME=20
170
+DELAYED_JOB_MAX_RUNTIME=2
171 171
 
172 172
 # Amount of seconds for delayed_job to sleep before checking for new jobs
173 173
 DELAYED_JOB_SLEEP_DELAY=10

+ 1 - 1
config/initializers/delayed_job.rb

@@ -1,6 +1,6 @@
1 1
 Delayed::Worker.destroy_failed_jobs = false
2 2
 Delayed::Worker.max_attempts = 5
3
-Delayed::Worker.max_run_time = (ENV['DELAYED_JOB_MAX_RUNTIME'].presence || 20).to_i.minutes
3
+Delayed::Worker.max_run_time = (ENV['DELAYED_JOB_MAX_RUNTIME'].presence || 2).to_i.minutes
4 4
 Delayed::Worker.read_ahead = 5
5 5
 Delayed::Worker.default_priority = 10
6 6
 Delayed::Worker.delay_jobs = !Rails.env.test?