Sha256: 002a4371ef3da10a292f09242d1a7c4b538835b1db81d3b97b0e3220aec4093a
Contents?: true
Size: 1.03 KB
Versions: 6
Compression:
Stored size: 1.03 KB
Contents
# frozen_string_literal: true module SidekiqAlive class Config include Singleton attr_accessor :host, :port, :path, :liveness_key, :time_to_live, :callback, :registered_instance_key, :queue_prefix, :server, :custom_liveness_probe def initialize set_defaults end def set_defaults @host = ENV.fetch('SIDEKIQ_ALIVE_HOST', '0.0.0.0') @port = ENV.fetch('SIDEKIQ_ALIVE_PORT', 7433) @path = ENV.fetch('SIDEKIQ_ALIVE_PATH', '/') @liveness_key = 'SIDEKIQ::LIVENESS_PROBE_TIMESTAMP' @time_to_live = 10 * 60 @callback = proc {} @registered_instance_key = 'SIDEKIQ_REGISTERED_INSTANCE' @queue_prefix = :sidekiq_alive @server = ENV.fetch('SIDEKIQ_ALIVE_SERVER', 'webrick') @custom_liveness_probe = proc { true } end def registration_ttl @registration_ttl || time_to_live + 60 end end end
Version data entries
6 entries across 6 versions & 1 rubygems