Module: Resque::Scheduler::Configuration
- Included in:
- Resque::Scheduler
- Defined in:
- lib/resque/scheduler/configuration.rb
Instance Attribute Summary collapse
- #app_name ⇒ Object
- #dynamic ⇒ Object
- #env ⇒ Object
- #environment ⇒ Object
- #logfile ⇒ Object
- #logformat ⇒ Object
- #poll_sleep_amount ⇒ Object
- #quiet ⇒ Object
- #verbose ⇒ Object
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Allows for block-style configuration.
- #delayed_requeue_batch_size ⇒ Object
Instance Attribute Details
#app_name ⇒ Object
64 65 66 |
# File 'lib/resque/scheduler/configuration.rb', line 64 def app_name @app_name ||= environment['APP_NAME'] end |
#dynamic ⇒ Object
57 58 59 |
# File 'lib/resque/scheduler/configuration.rb', line 57 def dynamic @dynamic ||= to_bool(environment['DYNAMIC_SCHEDULE']) end |
#env ⇒ Object
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 |
#environment ⇒ Object
12 13 14 |
# File 'lib/resque/scheduler/configuration.rb', line 12 def environment @environment ||= ENV end |
#logfile ⇒ Object
43 44 45 |
# File 'lib/resque/scheduler/configuration.rb', line 43 def logfile @logfile ||= environment['LOGFILE'] end |
#logformat ⇒ Object
50 51 52 |
# File 'lib/resque/scheduler/configuration.rb', line 50 def logformat @logformat ||= environment['LOGFORMAT'] end |
#poll_sleep_amount ⇒ Object
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 |
#quiet ⇒ Object
36 37 38 |
# File 'lib/resque/scheduler/configuration.rb', line 36 def quiet @quiet ||= to_bool(environment['QUIET']) end |
#verbose ⇒ Object
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
7 8 9 |
# File 'lib/resque/scheduler/configuration.rb', line 7 def configure yield self end |
#delayed_requeue_batch_size ⇒ Object
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 |