fix(DeclarativeProceduresJob.perform_now): avoid to crash other demarche when one fail

This commit is contained in:
Martin 2022-06-10 14:53:15 +02:00 committed by mfo
parent ab04369c06
commit b84c2966c4

View file

@ -2,6 +2,12 @@ class Cron::DeclarativeProceduresJob < Cron::CronJob
self.schedule_expression = "every 1 minute" self.schedule_expression = "every 1 minute"
def perform(*args) def perform(*args)
Procedure.declarative.find_each(&:process_dossiers!) Procedure.declarative.find_each do |procedure|
begin
procedure.process_dossiers!
rescue => e
Sentry.capture_exception(e)
end
end
end end
end end