mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
620ba4c12a
Use `+` instead of backquote.
22 lines
755 B
Ruby
22 lines
755 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ActionMailbox
|
|
# You can configure when this +IncinerationJob+ will be run as a time-after-processing using the
|
|
# +config.action_mailbox.incinerate_after+ or +ActionMailbox.incinerate_after+ setting.
|
|
#
|
|
# Since this incineration is set for the future, it'll automatically ignore any <tt>InboundEmail</tt>s
|
|
# that have already been deleted and discard itself if so.
|
|
class IncinerationJob < ActiveJob::Base
|
|
queue_as { ActionMailbox.queues[:incineration] }
|
|
|
|
discard_on ActiveRecord::RecordNotFound
|
|
|
|
def self.schedule(inbound_email)
|
|
set(wait: ActionMailbox.incinerate_after).perform_later(inbound_email)
|
|
end
|
|
|
|
def perform(inbound_email)
|
|
inbound_email.incinerate
|
|
end
|
|
end
|
|
end
|