Module: HireFire::Backend::DelayedJob::ActiveRecord2
- Defined in:
- lib/hirefire/backend/delayed_job/active_record_2.rb
Instance Method Summary collapse
-
#jobs ⇒ Fixnum
Counts the amount of queued jobs in the database, failed jobs are excluded from the sum.
-
#working ⇒ Fixnum
Counts the amount of jobs that are locked by a worker There is no other performant way to determine the amount of workers there currently are.
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_2.rb', line 13 def jobs ::Delayed::Job.all( :conditions => ['failed_at IS NULL and run_at <= ?', Time.now.utc] ).count end |
#working ⇒ Fixnum
Counts the amount of jobs that are locked by a worker There is no other performant way to determine the amount of workers there currently are
25 26 27 28 29 |
# File 'lib/hirefire/backend/delayed_job/active_record_2.rb', line 25 def working ::Delayed::Job.all( :conditions => 'locked_by IS NOT NULL' ).count end |