]> source.dussan.org Git - redmine.git/commitdiff
Mailer.with_synched_deliveries doesn't correctly detect other async Queue adapters...
authorGo MAEDA <maeda@farend.jp>
Wed, 12 Jan 2022 15:13:47 +0000 (15:13 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 12 Jan 2022 15:13:47 +0000 (15:13 +0000)
Patch by Felix Schäfer.

git-svn-id: http://svn.redmine.org/redmine/trunk@21362 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/mailer.rb

index 17518a18a9482487ddbb2d0cd9adda7b849a9b8c..cdf7aedbadf16085c6773175902841b960882704 100644 (file)
@@ -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