Sha256: 53e5eda6a5f22cf2a2dcecb78c7705ba14cdb1e7ff48b57263964a919b68f548

Contents?: true

Size: 482 Bytes

Versions: 9

Compression:

Stored size: 482 Bytes

Contents

module Que::Web::Viewmodels
  class Job < Struct.new(
    :args, :error_count, :job_class, :job_id, :last_error,
    :pg_backend_pid, :pg_last_query, :pg_last_query_started_at, :pg_state,
    :pg_state_changed_at, :pg_transaction_started_at, :pg_waiting_on_lock,
    :priority, :queue, :run_at)

    def initialize(job)
      members.each do |m|
        self[m] = job[m.to_s]
      end
    end

    def past_due?(relative_to = Time.now)
      run_at < relative_to
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
que-web-0.7.2 lib/que/web/viewmodels/job.rb
que-web-0.7.1 lib/que/web/viewmodels/job.rb
que-web-0.7.0 lib/que/web/viewmodels/job.rb
que-web-0.6.3 lib/que/web/viewmodels/job.rb
que-web-0.6.2 lib/que/web/viewmodels/job.rb
que-web-0.6.1 lib/que/web/viewmodels/job.rb
que-web-0.6.0 lib/que/web/viewmodels/job.rb
que-web-0.5.0 lib/que/web/viewmodels/job.rb
que-web-0.4.0 lib/que/web/viewmodels/job.rb