Sha256: 388456bf5a519bc1acbabe52d38f2d2c1cbd57aca4b61f5bb508c2f11f5fee4a
Contents?: true
Size: 445 Bytes
Versions: 10
Compression:
Stored size: 445 Bytes
Contents
class Kuroko2::ProcessSignal < Kuroko2::ApplicationRecord include Kuroko2::TableNameCustomizable belongs_to :execution scope :unstarted, -> { where(started_at: nil) } scope :on, ->(hostname) { joins(execution: :worker).merge(Kuroko2::Worker.on(hostname)) } def self.poll(hostname) self.transaction do unstarted.on(hostname).lock.take.tap do |signal| signal.touch(:started_at) if signal end end end end
Version data entries
10 entries across 10 versions & 1 rubygems