Class: PgFailover::Config
- Inherits:
-
Struct
- Object
- Struct
- PgFailover::Config
- Defined in:
- lib/pg_failover/config.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#throttle_interval ⇒ Object
Returns the value of attribute throttle_interval.
Instance Method Summary collapse
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled
6 7 8 |
# File 'lib/pg_failover/config.rb', line 6 def enabled @enabled end |
#logger ⇒ Object
Returns the value of attribute logger
6 7 8 |
# File 'lib/pg_failover/config.rb', line 6 def logger @logger end |
#max_retries ⇒ Object
Returns the value of attribute max_retries
6 7 8 |
# File 'lib/pg_failover/config.rb', line 6 def max_retries @max_retries end |
#throttle_interval ⇒ Object
Returns the value of attribute throttle_interval
6 7 8 |
# File 'lib/pg_failover/config.rb', line 6 def throttle_interval @throttle_interval end |
Instance Method Details
#enabled? ⇒ Boolean
23 24 25 |
# File 'lib/pg_failover/config.rb', line 23 def enabled? self[:enabled] ||= %w[1 t true].include?(ENV['POSTGRES_FAILOVER_ENABLED']) end |
#throttle_enabled? ⇒ Boolean
15 16 17 |
# File 'lib/pg_failover/config.rb', line 15 def throttle_enabled? !throttle_interval.zero? end |