class Resque::UniqueByArity::GlobalConfiguration

This class is for configurations that are app-wide, *not per job class. For this reason it is a Singleton. Will be used as the default settings for the per-job configs.

Constants

DEFAULT_AT_RUNTIME_KEY_BASE
DEFAULT_IN_QUEUE_KEY_BASE
DEFAULT_LOCK_AFTER_EXECUTION_PERIOD

For resque-unique_in_queue

DEFAULT_LOCK_TIMEOUT

For resque-unique_at_runtime

DEFAULT_LOG_LEVEL
DEFAULT_REQUEUE_INTERVAL
DEFAULT_TTL

Public Class Methods

new() click to toggle source
# File lib/resque/unique_by_arity/global_configuration.rb, line 22
def initialize
  reset
end

Public Instance Methods

defcon(sym) click to toggle source
# File lib/resque/unique_by_arity/global_configuration.rb, line 26
def defcon(sym)
  self.send(sym)
end
reset() click to toggle source
# File lib/resque/unique_by_arity/global_configuration.rb, line 30
def reset
  debug_mode_from_env
  @logger = nil
  @log_level = DEFAULT_LOG_LEVEL
  @arity_for_uniqueness = nil
  @arity_validation = nil
  @lock_after_execution_period = DEFAULT_LOCK_AFTER_EXECUTION_PERIOD
  @runtime_lock_timeout = DEFAULT_LOCK_TIMEOUT
  @runtime_requeue_interval = DEFAULT_REQUEUE_INTERVAL
  @unique_at_runtime_key_base = DEFAULT_AT_RUNTIME_KEY_BASE
  @unique_in_queue_key_base = DEFAULT_IN_QUEUE_KEY_BASE
  @unique_at_runtime = false
  @unique_in_queue = false
  @unique_across_queues = false
  @ttl = DEFAULT_TTL
  if @debug_mode
    # Make sure there is a logger when in debug_mode
    @logger ||= Logger.new(STDOUT)
  end
end