mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-27 23:42:12 +08:00
Fix discarding a job due to non-existant report [SCI-6409]
This commit is contained in:
parent
c570cef06c
commit
caabb6ff00
2 changed files with 4 additions and 2 deletions
app/jobs/reports
|
@ -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!
|
||||
|
|
|
@ -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!
|
||||
|
|
Loading…
Add table
Reference in a new issue