From 50329c6787ef6776bf8aff1abd830e4e1e3f4ab4 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 3 Nov 2023 19:30:53 +0000 Subject: [PATCH] Discard jobs that fail to deserialize --- app/jobs/application_job.rb | 6 +----- app/jobs/mail_delivery_job.rb | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 app/jobs/mail_delivery_job.rb diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index d394c3d106..632c75e198 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -1,7 +1,3 @@ class ApplicationJob < ActiveJob::Base - # Automatically retry jobs that encountered a deadlock - # retry_on ActiveRecord::Deadlocked - - # Most jobs are safe to ignore if the underlying records are no longer available - # discard_on ActiveJob::DeserializationError + discard_on ActiveJob::DeserializationError end diff --git a/app/jobs/mail_delivery_job.rb b/app/jobs/mail_delivery_job.rb new file mode 100644 index 0000000000..e09852a400 --- /dev/null +++ b/app/jobs/mail_delivery_job.rb @@ -0,0 +1,3 @@ +class MailDeliveryJob < ActionMailer::MailDeliveryJob + discard_on ActiveJob::DeserializationError +end