Enable/disable delayed jobs in the secrets file

While this is not a secret and in theory should be in a file under
version control, currently the CONSUL installer disables delayed jobs by
default, meaning we were keeping two versions of the delayed jobs
configuration file, and some existing configurations have their settings
defined in a file in capistrano's `shared` folder.

So we're moving existing settings to the secrets file.
This commit is contained in:
Javi Martín
2019-11-02 21:58:28 +01:00
parent 6ecd9e59dc
commit a08d42d3f8
4 changed files with 14 additions and 7 deletions

View File

@@ -1,8 +1,11 @@
if Rails.env.test? || Rails.env.development?
Delayed::Worker.delay_jobs = false
else
elsif Rails.application.secrets.delay_jobs.nil?
Delayed::Worker.delay_jobs = true
else
Delayed::Worker.delay_jobs = Rails.application.secrets.delay_jobs
end
Delayed::Worker.destroy_failed_jobs = false
Delayed::Worker.sleep_delay = 2
Delayed::Worker.max_attempts = 3