diff --git a/lib/vero/config.rb b/lib/vero/config.rb index c21b426..b23d3b4 100644 --- a/lib/vero/config.rb +++ b/lib/vero/config.rb @@ -3,7 +3,7 @@ module Vero class Config attr_writer :domain - attr_accessor :api_key, :secret, :development_mode, :async, :disabled, :logging + attr_accessor :api_key, :secret, :development_mode, :async, :disabled, :logging, :senders_config def self.available_attributes [:api_key, :secret, :development_mode, :async, :disabled, :logging, :domain] @@ -56,6 +56,10 @@ def reset! self.logging = false self.api_key = nil self.secret = nil + self.senders_config = [:delayed_job, :resque, :sidekiq, :sucker_punch].inject({}) do |hash,e| + hash[e] = {} + hash + end end def update_attributes(attributes = {}) diff --git a/lib/vero/senders/delayed_job.rb b/lib/vero/senders/delayed_job.rb index c75fe5c..54413eb 100644 --- a/lib/vero/senders/delayed_job.rb +++ b/lib/vero/senders/delayed_job.rb @@ -5,7 +5,8 @@ module Vero module Senders class DelayedJob def call(api_class, domain, options) - response = ::Delayed::Job.enqueue api_class.new(domain, options) + queue = Vero::App.default_context.senders_config.fetch(:delayed_job, {}).fetch(:queue, :default) + response = ::Delayed::Job.enqueue(api_class.new(domain, options), queue: queue) options_s = JSON.dump(options) Vero::App.log(self, "method: #{api_class.name}, options: #{options_s}, response: delayed job queued") response diff --git a/lib/vero/version.rb b/lib/vero/version.rb index 6056833..706a172 100644 --- a/lib/vero/version.rb +++ b/lib/vero/version.rb @@ -1,3 +1,3 @@ module Vero - VERSION = '0.9.1' + VERSION = '0.9.2' end