Merge pull request #3784 from artoscinote/ma_SCI_6409

Fix discarding a job due to non-existant report [SCI-6409]
This commit is contained in:
Alex Kriuchykhin 2022-01-17 11:42:47 +01:00 committed by GitHub
commit 79739371b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

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!