diff --git a/app/jobs/reports/docx_job.rb b/app/jobs/reports/docx_job.rb index 9be2fcebe..ccd4b5d6b 100644 --- a/app/jobs/reports/docx_job.rb +++ b/app/jobs/reports/docx_job.rb @@ -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! diff --git a/app/jobs/reports/pdf_job.rb b/app/jobs/reports/pdf_job.rb index e70107ac6..c83b280d2 100644 --- a/app/jobs/reports/pdf_job.rb +++ b/app/jobs/reports/pdf_job.rb @@ -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!