From d0037daa3738ac754781ce5e55778a2cf9d3d2f7 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 6 Feb 2019 18:28:49 -0600 Subject: Allow skipping incineration of processed emails --- actionmailbox/lib/action_mailbox.rb | 1 + actionmailbox/lib/action_mailbox/engine.rb | 2 ++ 2 files changed, 3 insertions(+) (limited to 'actionmailbox/lib') diff --git a/actionmailbox/lib/action_mailbox.rb b/actionmailbox/lib/action_mailbox.rb index b4ff25a9ab..772dbd6529 100644 --- a/actionmailbox/lib/action_mailbox.rb +++ b/actionmailbox/lib/action_mailbox.rb @@ -11,6 +11,7 @@ module ActionMailbox mattr_accessor :ingress mattr_accessor :logger + mattr_accessor :incinerate, default: true mattr_accessor :incinerate_after, default: 30.days mattr_accessor :queues, default: {} end diff --git a/actionmailbox/lib/action_mailbox/engine.rb b/actionmailbox/lib/action_mailbox/engine.rb index d5a07a7dce..27334c037e 100644 --- a/actionmailbox/lib/action_mailbox/engine.rb +++ b/actionmailbox/lib/action_mailbox/engine.rb @@ -14,6 +14,7 @@ module ActionMailbox config.eager_load_namespaces << ActionMailbox config.action_mailbox = ActiveSupport::OrderedOptions.new + config.action_mailbox.incinerate = true config.action_mailbox.incinerate_after = 30.days config.action_mailbox.queues = ActiveSupport::InheritableOptions.new \ @@ -22,6 +23,7 @@ module ActionMailbox initializer "action_mailbox.config" do config.after_initialize do |app| ActionMailbox.logger = app.config.action_mailbox.logger || Rails.logger + ActionMailbox.incinerate = app.config.action_mailbox.incinerate.nil? ? true : app.config.action_mailbox.incinerate ActionMailbox.incinerate_after = app.config.action_mailbox.incinerate_after || 30.days ActionMailbox.queues = app.config.action_mailbox.queues || {} end -- cgit v1.2.3