do not run ApiEntreprise jobs on missing etablissements
This commit is contained in:
parent
dd43c46e5e
commit
245e9e59c7
2 changed files with 14 additions and 0 deletions
|
@ -3,6 +3,10 @@ class ApiEntreprise::Job < ApplicationJob
|
|||
|
||||
DEFAULT_MAX_ATTEMPTS_API_ENTREPRISE_JOBS = 5
|
||||
|
||||
# If by the time the job runs the Etablissement has been deleted
|
||||
# (it can happen through EtablissementUpdateJob for instance), ignore the job
|
||||
discard_on ActiveRecord::RecordNotFound
|
||||
|
||||
rescue_from(ApiEntreprise::API::ResourceNotFound) do |exception|
|
||||
error(self, exception)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue