From 9670c7fe2231c36595e1135e691c3eb2ebfa2a3d Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Wed, 12 Jan 2022 15:13:47 +0000 Subject: [PATCH] Mailer.with_synched_deliveries doesn't correctly detect other async Queue adapters (#36393). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Felix Schäfer. git-svn-id: http://svn.redmine.org/redmine/trunk@21362 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mailer.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 17518a18a..cdf7aedba 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -643,9 +643,7 @@ class Mailer < ActionMailer::Base # any/all of the .deliver_later emails are processed def self.with_synched_deliveries(&block) adapter = ActionMailer::MailDeliveryJob.queue_adapter - if adapter.is_a?(ActiveJob::QueueAdapters::AsyncAdapter) - ActionMailer::MailDeliveryJob.queue_adapter = ActiveJob::QueueAdapters::InlineAdapter.new - end + ActionMailer::MailDeliveryJob.queue_adapter = ActiveJob::QueueAdapters::InlineAdapter.new yield ensure ActionMailer::MailDeliveryJob.queue_adapter = adapter -- 2.39.5