Class: OnlineMigrations::BackgroundSchemaMigrations::Config
- Inherits:
-
Object
- Object
- OnlineMigrations::BackgroundSchemaMigrations::Config
- Defined in:
- lib/online_migrations/background_schema_migrations/config.rb
Overview
Class representing configuration options for background schema migrations.
Instance Attribute Summary collapse
-
#error_handler ⇒ Proc
The callback to perform when an error occurs in the migration.
-
#max_attempts ⇒ Integer
Maximum number of run attempts.
-
#statement_timeout ⇒ Integer
Statement timeout value used when running background schema migration.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
33 34 35 36 37 |
# File 'lib/online_migrations/background_schema_migrations/config.rb', line 33 def initialize @max_attempts = 5 @statement_timeout = 1.hour @error_handler = ->(error, errored_migration) {} end |
Instance Attribute Details
#error_handler ⇒ Proc
The callback to perform when an error occurs in the migration.
31 32 33 |
# File 'lib/online_migrations/background_schema_migrations/config.rb', line 31 def error_handler @error_handler end |
#max_attempts ⇒ Integer
Maximum number of run attempts
When attempts are exhausted, the migration is marked as failed.
12 13 14 |
# File 'lib/online_migrations/background_schema_migrations/config.rb', line 12 def max_attempts @max_attempts end |
#statement_timeout ⇒ Integer
Statement timeout value used when running background schema migration.
18 19 20 |
# File 'lib/online_migrations/background_schema_migrations/config.rb', line 18 def statement_timeout @statement_timeout end |