Fix discarding a job due to non-existant report [SCI-6409]

This commit is contained in:
Martin Artnik 2022-01-17 11:39:42 +01:00
parent c570cef06c
commit caabb6ff00
2 changed files with 4 additions and 2 deletions
app/jobs/reports

View file

@ -8,7 +8,8 @@ module Reports
queue_as :reports
discard_on StandardError do |job, error|
report = Report.find(job.arguments.first)
report = Report.find_by(id: job.arguments.first)
next unless report
ActiveRecord::Base.no_touching do
report.docx_error!

View file

@ -12,7 +12,8 @@ module Reports
queue_as :reports
discard_on StandardError do |job, error|
report = Report.find(job.arguments.first)
report = Report.find_by(id: job.arguments.first)
next unless report
ActiveRecord::Base.no_touching do
report.pdf_error!