Module: HireFire::Backend::DelayedJob::ActiveRecord
- Defined in:
- lib/hirefire/backend/delayed_job/active_record.rb
Instance Method Summary collapse
-
#jobs ⇒ Fixnum
Counts the amount of queued jobs in the database, failed jobs are excluded from the sum.
-
#workers ⇒ Fixnum
Counts the amount of jobs that are locked by a worker.
Instance Method Details
#jobs ⇒ Fixnum
Counts the amount of queued jobs in the database, failed jobs are excluded from the sum
13 14 15 16 17 |
# File 'lib/hirefire/backend/delayed_job/active_record.rb', line 13 def jobs ::Delayed::Job. where(:failed_at => nil). where('run_at <= ?', Time.now).count end |
#workers ⇒ Fixnum
Counts the amount of jobs that are locked by a worker
23 24 25 26 |
# File 'lib/hirefire/backend/delayed_job/active_record.rb', line 23 def workers ::Delayed::Job. where('locked_by IS NOT NULL').count end |