1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-31 19:47:14 +00:00

Mailer.with_synched_deliveries doesn't correctly detect other async Queue adapters (#36393).

Patch by Felix Schäfer.


git-svn-id: http://svn.redmine.org/redmine/trunk@21362 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2022-01-12 15:13:47 +00:00
parent 873580ca74
commit 9670c7fe22

View 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