fix: rescue and sentry log procedure.purge_discarded to avoid blowing up the whole job
This commit is contained in:
parent
fe508c0a73
commit
ab4a6b1c7d
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue