Sha256: b23b350350c58b980148a0003071296a7163b2a8e36d850d1271a0c8c5254f7a

Contents?: true

Size: 1.31 KB

Versions: 60

Compression:

Stored size: 1.31 KB

Contents

if defined?(Resque::Worker)
  Resque.send(:extend, Resque::Additions)
  Resque::Worker.send(:include, Resque::DynamicQueues)
  Resque::Worker.send(:include, Resque::SilenceDone) if ZuoraConnect.configuration.silencer_resque_finish == true
  Resque::Job.send(:include, Resque::SelfLookup)
end

Resque.module_eval do
  # Returns a hash, mapping queue names to queue sizes
  def queue_sizes
    paused_queues = Resque.redis.zrange("PauseQueue", 0, -1).map! {|key| key.split("__")[0]}
    queue_names = queues.delete_if{|name| paused_queues.include?(name.split("_")[0])}

    sizes = redis.pipelined do
      queue_names.each do |name|
        redis.llen("queue:#{name}")
      end
    end

    Hash[queue_names.zip(sizes)]
  end
end

if defined?(Resque)
  Resque.logger = ZuoraConnect.custom_logger(name: "Resque", type: 'Monologger', level: MonoLogger::INFO) 
  Resque::Scheduler.logger = ZuoraConnect.custom_logger(name: "ResqueScheduler") if defined?(Resque::Scheduler)
end

Makara::Logging::Logger.logger = ZuoraConnect.custom_logger(name: "Makara") if defined?(Makara)
ElasticAPM.agent.config.logger = ZuoraConnect.custom_logger(name: "ElasticAPM", level: MonoLogger::WARN) if defined?(ElasticAPM) && ElasticAPM.running?
ActionMailer::Base.logger = ZuoraConnect.custom_logger(name: "ActionMailer", type: 'Monologger') if defined?(ActionMailer)

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
zuora_connect-2.0.11 config/initializers/resque.rb
zuora_connect-2.0.10 config/initializers/resque.rb
zuora_connect-2.0.9 config/initializers/resque.rb
zuora_connect-2.0.8 config/initializers/resque.rb
zuora_connect-2.0.5zj config/initializers/resque.rb
zuora_connect-2.0.5zi config/initializers/resque.rb
zuora_connect-2.0.5zh config/initializers/resque.rb
zuora_connect-2.0.5zg config/initializers/resque.rb
zuora_connect-2.0.5ze config/initializers/resque.rb
zuora_connect-2.0.5zd config/initializers/resque.rb
zuora_connect-2.0.5zc config/initializers/resque.rb
zuora_connect-2.0.5zb config/initializers/resque.rb
zuora_connect-2.0.5za config/initializers/resque.rb
zuora_connect-2.0.5zz config/initializers/resque.rb
zuora_connect-2.0.5z config/initializers/resque.rb
zuora_connect-2.0.5y config/initializers/resque.rb
zuora_connect-2.0.5x config/initializers/resque.rb
zuora_connect-2.0.5w config/initializers/resque.rb
zuora_connect-2.0.5v config/initializers/resque.rb
zuora_connect-2.0.5u config/initializers/resque.rb