Sha256: 01f1842797cdca53c819c11e534ff31a70f1f0ff833c32f31e9bfbe86d8efca5
Contents?: true
Size: 925 Bytes
Versions: 18
Compression:
Stored size: 925 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" module AcidicJob module Extensions module ActionMailer extend ActiveSupport::Concern def deliver_acidicly(_options = {}) job_class = ::ActionMailer::MailDeliveryJob job_args = [@mailer_class.name, @action.to_s, "deliver_now", @params, *@args] # for Sidekiq, this depends on the Sidekiq::Serialization extension serialized_job = job_class.new(job_args).serialize acidic_identifier = job_class.respond_to?(:acidic_identifier) ? job_class.acidic_identifier : :job_id key = IdempotencyKey.new(acidic_identifier).value_for(serialized_job) AcidicJob::Run.create!( staged: true, job_class: job_class.name, serialized_job: serialized_job, idempotency_key: key ) end alias deliver_transactionally deliver_acidicly end end end
Version data entries
18 entries across 18 versions & 1 rubygems