Module: HireFire::Backend::DelayedJob::Mongoid
- Defined in:
- lib/hirefire/backend/delayed_job/mongoid.rb
Instance Method Summary collapse
-
#jobs ⇒ Fixnum
Counts the amount of queued jobs in the database, failed jobs and jobs scheduled for the future are excluded.
-
#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 and jobs scheduled for the future are excluded
13 14 15 16 17 18 |
# File 'lib/hirefire/backend/delayed_job/mongoid.rb', line 13 def jobs ::Delayed::Job.where( :failed_at => nil, :run_at.lte => Time.now ).count end |
#workers ⇒ Fixnum
Counts the amount of jobs that are locked by a worker
24 25 26 27 |
# File 'lib/hirefire/backend/delayed_job/mongoid.rb', line 24 def workers ::Delayed::Job. where(:locked_by.ne => nil).count end |