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
643 643
  # any/all of the .deliver_later emails are processed
644 644
  def self.with_synched_deliveries(&block)
645 645
    adapter = ActionMailer::MailDeliveryJob.queue_adapter
646
    if adapter.is_a?(ActiveJob::QueueAdapters::AsyncAdapter)
647
      ActionMailer::MailDeliveryJob.queue_adapter = ActiveJob::QueueAdapters::InlineAdapter.new
648
    end
646
    ActionMailer::MailDeliveryJob.queue_adapter = ActiveJob::QueueAdapters::InlineAdapter.new
649 647
    yield
650 648
  ensure
651 649
    ActionMailer::MailDeliveryJob.queue_adapter = adapter
    (1-1/1)