diff --git a/app/jobs/api_entreprise/job.rb b/app/jobs/api_entreprise/job.rb index 7853100ce..912431b8d 100644 --- a/app/jobs/api_entreprise/job.rb +++ b/app/jobs/api_entreprise/job.rb @@ -10,6 +10,6 @@ class ApiEntreprise::Job < ApplicationJob end def max_attempts - ENV[MAX_ATTEMPTS_API_ENTREPRISE_JOBS].to_i || DEFAULT_MAX_ATTEMPTS_API_ENTREPRISE_JOBS + ENV.fetch("MAX_ATTEMPTS_API_ENTREPRISE_JOBS", DEFAULT_MAX_ATTEMPTS_API_ENTREPRISE_JOBS).to_i end end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index b914d7bd9..2dfbc497c 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -14,6 +14,6 @@ class ApplicationJob < ActiveJob::Base end def max_attempts - ENV["MAX_ATTEMPTS_JOBS"].to_i || DEFAULT_MAX_ATTEMPTS_JOBS + ENV.fetch("MAX_ATTEMPTS_JOBS", DEFAULT_MAX_ATTEMPTS_JOBS).to_i end end