Module: HireFire::Macro::Deprecated::Que
- Included in:
- Que
- Defined in:
- lib/hirefire/macro/deprecated/que.rb
Overview
Provides backward compatibility with the deprecated Que macro. For new implementations, refer to Que.
Instance Method Summary collapse
-
#queue(*queues) ⇒ Integer
Retrieves the total number of jobs in the specified queue(s) using Que.
Instance Method Details
#queue(*queues) ⇒ Integer
Retrieves the total number of jobs in the specified queue(s) using Que.
This method queries the PostgreSQL database through Que. It can count jobs in specified queues or all queues if no specific queue is provided. The method determines the base query depending on the Que version detected.
22 23 24 25 26 |
# File 'lib/hirefire/macro/deprecated/que.rb', line 22 def queue(*queues) query = queues.empty? ? Private.base_query : "#{Private.base_query} AND queue IN (#{Private.names(queues)})" results = ::Que.execute(query).first (results[:total] || results["total"]).to_i end |