Sha256: 8170fab9724f1d9a572d022085149f1eb46034c5d4b32b4640ecb40cd3926f7c
Contents?: true
Size: 384 Bytes
Versions: 12
Compression:
Stored size: 384 Bytes
Contents
class Kuroko2::ProcessSignal < Kuroko2::ApplicationRecord include Kuroko2::TableNameCustomizable scope :unstarted, -> { where(started_at: nil) } scope :on, ->(hostname) { where(hostname: 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
12 entries across 12 versions & 1 rubygems