diff options
author | Pratik <pratiknaik@gmail.com> | 2019-02-06 18:28:49 -0600 |
---|---|---|
committer | George Claghorn <george.claghorn@gmail.com> | 2019-02-06 19:28:49 -0500 |
commit | d0037daa3738ac754781ce5e55778a2cf9d3d2f7 (patch) | |
tree | 8d8a6c476baf7f85373c182bdbc8dc75835521c1 /actionmailbox/app | |
parent | 9cc463ed7b7be098602b72a98f72220ea6466ba2 (diff) | |
download | rails-d0037daa3738ac754781ce5e55778a2cf9d3d2f7.tar.gz rails-d0037daa3738ac754781ce5e55778a2cf9d3d2f7.tar.bz2 rails-d0037daa3738ac754781ce5e55778a2cf9d3d2f7.zip |
Allow skipping incineration of processed emails
Diffstat (limited to 'actionmailbox/app')
-rw-r--r-- | actionmailbox/app/jobs/action_mailbox/incineration_job.rb | 3 | ||||
-rw-r--r-- | actionmailbox/app/models/action_mailbox/inbound_email/incineratable.rb | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/actionmailbox/app/jobs/action_mailbox/incineration_job.rb b/actionmailbox/app/jobs/action_mailbox/incineration_job.rb index 1579a3c7c8..351bd67c69 100644 --- a/actionmailbox/app/jobs/action_mailbox/incineration_job.rb +++ b/actionmailbox/app/jobs/action_mailbox/incineration_job.rb @@ -6,6 +6,9 @@ module ActionMailbox # # 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. + # + # You can disable incinerating processed emails by setting +config.action_mailbox.incinerate+ or + # +ActionMailbox.incinerate+ to +false+. class IncinerationJob < ActiveJob::Base queue_as { ActionMailbox.queues[:incineration] } diff --git a/actionmailbox/app/models/action_mailbox/inbound_email/incineratable.rb b/actionmailbox/app/models/action_mailbox/inbound_email/incineratable.rb index 697331ede4..e7c8782f33 100644 --- a/actionmailbox/app/models/action_mailbox/inbound_email/incineratable.rb +++ b/actionmailbox/app/models/action_mailbox/inbound_email/incineratable.rb @@ -7,7 +7,7 @@ module ActionMailbox::InboundEmail::Incineratable extend ActiveSupport::Concern included do - after_update_commit :incinerate_later, if: -> { status_previously_changed? && processed? } + after_update_commit :incinerate_later, if: -> { ActionMailbox.incinerate && status_previously_changed? && processed? } end def incinerate_later |