Module: HireFire::Macro::Deprecated::GoodJob
- Includes:
- Helpers::GoodJob
- Included in:
- GoodJob
- Defined in:
- lib/hirefire/macro/deprecated/good_job.rb
Overview
Provides backward compatibility with the deprecated GoodJob macro. For new implementations, refer to GoodJob.
Instance Method Summary collapse
-
#queue(*queues) ⇒ Integer
Retrieves the total number of jobs in the specified queue(s) using GoodJob.
Methods included from Helpers::GoodJob
#error_event_supported?, #good_job_class, included
Instance Method Details
#queue(*queues) ⇒ Integer
Retrieves the total number of jobs in the specified queue(s) using GoodJob.
This method queries the PostgreSQL database through GoodJob. It’s capable of counting jobs across different queues or all queues if none specified. The method checks for the existence of ::GoodJob::Execution or ::GoodJob::Job to determine the base class to use for querying.
27 28 29 30 31 |
# File 'lib/hirefire/macro/deprecated/good_job.rb', line 27 def queue(*queues) scope = good_job_class.only_scheduled.unfinished scope = scope.where(queue_name: queues) if queues.any? scope.count end |