Sha256: c7ed88844ae950ab2e9a83dc6c4826683336e15e8eb378011d501d2a27c3da96

Contents?: true

Size: 368 Bytes

Versions: 1

Compression:

Stored size: 368 Bytes

Contents

# encoding: utf-8

module HireFire
  module Backend
    module ActiveRecord

      ##
      # Counts the amount of queued jobs in the database,
      # failed jobs are excluded from the sum
      #
      # @return [Fixnum]
      def jobs
        Delayed::Job.
        where(:failed_at => nil).
        where('run_at <= ?', Time.now).count
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hirefire-0.1.0 lib/hirefire/backend/active_record.rb