Sha256: 3e5282a1c006447a99baac582831e82c1ce949a8abd5ec035a206b977674ddee

Contents?: true

Size: 454 Bytes

Versions: 12

Compression:

Stored size: 454 Bytes

Contents

class MissionControl::Jobs::Worker
  include ActiveModel::Model

  attr_accessor :id, :name, :hostname, :last_heartbeat_at, :configuration, :raw_data

  def initialize(queue_adapter: ActiveJob::Base.queue_adapter, **kwargs)
    @queue_adapter = queue_adapter
    super(**kwargs)
  end

  def jobs
    @jobs ||= ActiveJob::JobsRelation.new(queue_adapter: queue_adapter).in_progress.where(worker_id: id)
  end

  private
    attr_reader :queue_adapter
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mission_control-jobs-0.6.0 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.5.0 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.4.0 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.3.3 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.3.2 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.3.1 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.3.0 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.2.2 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.2.1 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.2.0 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.1.1 app/models/mission_control/jobs/worker.rb
mission_control-jobs-0.1.0 app/models/mission_control/jobs/worker.rb