Module: Resque::Scheduler::Configuration

Included in:
Resque::Scheduler
Defined in:
lib/resque/scheduler/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#app_nameObject



64
65
66
# File 'lib/resque/scheduler/configuration.rb', line 64

def app_name
  @app_name ||= environment['APP_NAME']
end

#dynamicObject



57
58
59
# File 'lib/resque/scheduler/configuration.rb', line 57

def dynamic
  @dynamic ||= to_bool(environment['DYNAMIC_SCHEDULE'])
end

#envObject



19
20
21
22
23
24
# File 'lib/resque/scheduler/configuration.rb', line 19

def env
  return @env if @env
  @env ||= Rails.env if defined?(Rails) && Rails.respond_to?(:env)
  @env ||= environment['RAILS_ENV']
  @env
end

#environmentObject



12
13
14
# File 'lib/resque/scheduler/configuration.rb', line 12

def environment
  @environment ||= ENV
end

#logfileObject



43
44
45
# File 'lib/resque/scheduler/configuration.rb', line 43

def logfile
  @logfile ||= environment['LOGFILE']
end

#logformatObject



50
51
52
# File 'lib/resque/scheduler/configuration.rb', line 50

def logformat
  @logformat ||= environment['LOGFORMAT']
end

#poll_sleep_amountObject



78
79
80
81
# File 'lib/resque/scheduler/configuration.rb', line 78

def poll_sleep_amount
  @poll_sleep_amount ||=
    Float(environment.fetch('RESQUE_SCHEDULER_INTERVAL', '5'))
end

#quietObject



36
37
38
# File 'lib/resque/scheduler/configuration.rb', line 36

def quiet
  @quiet ||= to_bool(environment['QUIET'])
end

#verboseObject



29
30
31
# File 'lib/resque/scheduler/configuration.rb', line 29

def verbose
  @verbose ||= to_bool(environment['VERBOSE'])
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Allows for block-style configuration

Yields:

  • (_self)

Yield Parameters:



7
8
9
# File 'lib/resque/scheduler/configuration.rb', line 7

def configure
  yield self
end

#delayed_requeue_batch_sizeObject



68
69
70
71
72
# File 'lib/resque/scheduler/configuration.rb', line 68

def delayed_requeue_batch_size
  @delayed_requeue_batch_size ||= \
    ENV['DELAYED_REQUEUE_BATCH_SIZE'].to_i if environment['DELAYED_REQUEUE_BATCH_SIZE']
  @delayed_requeue_batch_size ||= 100
end