Module: HireFire::Macro::Sidekiq
Instance Method Summary collapse
-
#queue(*queues) ⇒ Integer
Counts the amount of jobs in the (provided) Sidekiq queue(s).
Instance Method Details
#queue(*queues) ⇒ Integer
Counts the amount of jobs in the (provided) Sidekiq queue(s).
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/hirefire/macro/sidekiq.rb', line 20 def queue(*queues) require "sidekiq/api" queues.flatten! if queues.last.is_a?(Hash) = queues.pop else = {} end queues.map!(&:to_s) all_queues = ::Sidekiq::Queue.all.map(&:name) queues = all_queues if queues.empty? if fast_lookup_capable?(queues, all_queues) fast_lookup() else dynamic_lookup(queues, ) end end |