Class: OnlineMigrations::BackgroundSchemaMigrations::Scheduler
- Inherits:
-
Object
- Object
- OnlineMigrations::BackgroundSchemaMigrations::Scheduler
- Defined in:
- lib/online_migrations/background_schema_migrations/scheduler.rb
Overview
Class responsible for scheduling background schema migrations. It selects a single migration and runs it if there is no currently running migration on the same table.
Scheduler should be configured to run periodically, for example, via cron.
Class Method Summary collapse
Instance Method Summary collapse
-
#run(**options) ⇒ Object
Runs Scheduler.
Class Method Details
.run(**options) ⇒ Object
23 24 25 |
# File 'lib/online_migrations/background_schema_migrations/scheduler.rb', line 23 def self.run(**) new.run(**) end |
Instance Method Details
#run(**options) ⇒ Object
Runs Scheduler
28 29 30 31 32 33 34 |
# File 'lib/online_migrations/background_schema_migrations/scheduler.rb', line 28 def run(**) migration = find_migration(**) if migration runner = MigrationRunner.new(migration) runner.run end end |