Sha256: fd788b47a59d5ff7b9821987230399eb302102c00c9a9cca9bfe8c2fc8ed2f23
Contents?: true
Size: 853 Bytes
Versions: 1
Compression:
Stored size: 853 Bytes
Contents
require "crono_trigger/worker" module CronoTrigger module Models class Worker < ActiveRecord::Base self.table_name = "crono_trigger_workers" ALIVE_THRESHOLD = CronoTrigger::Worker::HEARTBEAT_INTERVAL * 5 if ActiveRecord.version >= Gem::Version.new("7.0") enum :executor_status, {running: "running", quiet: "quiet", shuttingdown: "shuttingdown", shutdown: "shutdown"} else enum executor_status: {running: "running", quiet: "quiet", shuttingdown: "shuttingdown", shutdown: "shutdown"} end if ActiveRecord.version >= Gem::Version.new("7.1.0") serialize :polling_model_names, coder: JSON else serialize :polling_model_names, JSON end scope :alive_workers, proc { where(arel_table[:last_heartbeated_at].gteq(Time.current - ALIVE_THRESHOLD)) } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
crono_trigger-0.8.3 | lib/crono_trigger/models/worker.rb |