class Delayed::Heartbeat::Configuration

Attributes

enabled[RW]
enabled?[RW]
heartbeat_interval_seconds[RW]
heartbeat_timeout_seconds[RW]
on_worker_termination[RW]
worker_label[RW]
worker_termination_enabled[RW]
worker_termination_enabled?[RW]
worker_version[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/delayed/heartbeat/configuration.rb, line 12
def initialize(options = {})
  options.each do |key, value|
    send("#{key}=", value)
  end

  if enabled.nil?
    self.enabled = defined?(Rails) ? Rails.env.production? : true
  end

  if worker_termination_enabled.nil?
    self.worker_termination_enabled = defined?(Rails) ? Rails.env.production? : true
  end

  self.heartbeat_timeout_seconds ||= 180
  self.heartbeat_interval_seconds ||= 60
  self.on_worker_termination ||= Proc.new {}
end