Project

General

Profile

Defect #36393 » 36393-synched_deliveries_always_inline.patch

Felix Schäfer, 2022-01-06 15:55

View differences:

app/models/mailer.rb
# 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
    (1-1/1)