From ab4a6b1c7dba9a8e9a04ea559b957e6bc09dbcaa Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Thu, 11 Apr 2024 10:46:05 +0200 Subject: [PATCH] fix: rescue and sentry log procedure.purge_discarded to avoid blowing up the whole job --- app/models/procedure.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 5c51e83bb..827f417d5 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -770,7 +770,11 @@ class Procedure < ApplicationRecord end def self.purge_discarded - discarded_expired.find_each(&:purge_discarded) + discarded_expired.find_each do |p| + p.purge_discarded + rescue StandardError => e + Sentry.capture_exception(e, extra: { procedure_id: p.id }) + end end def restore(author)