Class: ActiveRecordPostgresRecovery::Configuration
- Inherits:
-
Object
- Object
- ActiveRecordPostgresRecovery::Configuration
- Defined in:
- lib/active_record_postgres_recovery/configuration.rb
Constant Summary collapse
- BOOLEAN_FALSE_VALUES =
[false, nil, 'false', 'FALSE', '0', 0, 'no', 'NO', 'off', 'OFF'].freeze
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#error_patterns ⇒ Object
Returns the value of attribute error_patterns.
-
#failover_clear_roles ⇒ Object
Returns the value of attribute failover_clear_roles.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#reporter ⇒ Object
Returns the value of attribute reporter.
-
#retry_read_queries ⇒ Object
Returns the value of attribute retry_read_queries.
-
#roles ⇒ Object
Returns the value of attribute roles.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #retry_read_queries? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/active_record_postgres_recovery/configuration.rb', line 10 def initialize self.enabled = true @reporter = nil self.roles = %i[writing reading] self.failover_clear_roles = %i[writing] self.retry_read_queries = true self.max_retries = 1 @error_patterns = [ /PQconsumeInput\(\).*terminating connection due to administrator command.*SSL connection has been closed unexpectedly/im, /PQsocket\(\) can't get socket descriptor/i, /read-only transaction/i ] end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
8 9 10 |
# File 'lib/active_record_postgres_recovery/configuration.rb', line 8 def enabled @enabled end |
#error_patterns ⇒ Object
Returns the value of attribute error_patterns.
7 8 9 |
# File 'lib/active_record_postgres_recovery/configuration.rb', line 7 def error_patterns @error_patterns end |
#failover_clear_roles ⇒ Object
Returns the value of attribute failover_clear_roles.
8 9 10 |
# File 'lib/active_record_postgres_recovery/configuration.rb', line 8 def failover_clear_roles @failover_clear_roles end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
8 9 10 |
# File 'lib/active_record_postgres_recovery/configuration.rb', line 8 def max_retries @max_retries end |
#reporter ⇒ Object
Returns the value of attribute reporter.
7 8 9 |
# File 'lib/active_record_postgres_recovery/configuration.rb', line 7 def reporter @reporter end |
#retry_read_queries ⇒ Object
Returns the value of attribute retry_read_queries.
8 9 10 |
# File 'lib/active_record_postgres_recovery/configuration.rb', line 8 def retry_read_queries @retry_read_queries end |
#roles ⇒ Object
Returns the value of attribute roles.
8 9 10 |
# File 'lib/active_record_postgres_recovery/configuration.rb', line 8 def roles @roles end |
Instance Method Details
#enabled? ⇒ Boolean
28 29 30 |
# File 'lib/active_record_postgres_recovery/configuration.rb', line 28 def enabled? enabled end |
#retry_read_queries? ⇒ Boolean
36 37 38 |
# File 'lib/active_record_postgres_recovery/configuration.rb', line 36 def retry_read_queries? retry_read_queries end |