Class: OnlineMigrations::BackgroundDataMigrations::Config
- Inherits:
-
Object
- Object
- OnlineMigrations::BackgroundDataMigrations::Config
- Defined in:
- lib/online_migrations/background_data_migrations/config.rb
Overview
Class representing configuration options for data migrations.
Instance Attribute Summary collapse
-
#error_handler ⇒ Proc
The callback to perform when an error occurs during the data migration.
-
#iteration_pause ⇒ Integer
The pause interval between each data migration’s ‘process` method execution (in seconds).
-
#job ⇒ String
The name of the sidekiq job to be used to perform data migrations.
-
#max_attempts ⇒ Integer
Maximum number of run attempts.
-
#migrations_module ⇒ String
The module in which data migrations will be placed.
-
#migrations_path ⇒ String
The path where generated data migrations will be placed.
-
#stuck_timeout ⇒ Integer
The number of seconds that must pass before the cancelling or pausing data migration is considered stuck.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
51 52 53 54 55 56 57 58 59 |
# File 'lib/online_migrations/background_data_migrations/config.rb', line 51 def initialize @migrations_path = "lib" @migrations_module = "OnlineMigrations::DataMigrations" @max_attempts = 5 @stuck_timeout = 5.minutes @iteration_pause = 0.seconds @error_handler = ->(error, errored_migration) {} @job = "OnlineMigrations::BackgroundDataMigrations::MigrationJob" end |
Instance Attribute Details
#error_handler ⇒ Proc
The callback to perform when an error occurs during the data migration.
43 44 45 |
# File 'lib/online_migrations/background_data_migrations/config.rb', line 43 def error_handler @error_handler end |
#iteration_pause ⇒ Integer
The pause interval between each data migration’s ‘process` method execution (in seconds).
30 31 32 |
# File 'lib/online_migrations/background_data_migrations/config.rb', line 30 def iteration_pause @iteration_pause end |
#job ⇒ String
The name of the sidekiq job to be used to perform data migrations.
49 50 51 |
# File 'lib/online_migrations/background_data_migrations/config.rb', line 49 def job @job end |
#max_attempts ⇒ Integer
Maximum number of run attempts.
When attempts are exhausted, the data migration is marked as failed.
19 20 21 |
# File 'lib/online_migrations/background_data_migrations/config.rb', line 19 def max_attempts @max_attempts end |
#migrations_module ⇒ String
The module in which data migrations will be placed.
13 14 15 |
# File 'lib/online_migrations/background_data_migrations/config.rb', line 13 def migrations_module @migrations_module end |
#migrations_path ⇒ String
The path where generated data migrations will be placed.
9 10 11 |
# File 'lib/online_migrations/background_data_migrations/config.rb', line 9 def migrations_path @migrations_path end |
#stuck_timeout ⇒ Integer
The number of seconds that must pass before the cancelling or pausing data migration is considered stuck.
25 26 27 |
# File 'lib/online_migrations/background_data_migrations/config.rb', line 25 def stuck_timeout @stuck_timeout end |