fix: rescue and sentry log procedure.purge_discarded to avoid blowing up the whole job

This commit is contained in:
simon lehericey 2024-04-11 10:46:05 +02:00
parent fe508c0a73
commit ab4a6b1c7d
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5

View file

@ -770,7 +770,11 @@ class Procedure < ApplicationRecord
end end
def self.purge_discarded 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 end
def restore(author) def restore(author)