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 ⇒ Object
Runs Scheduler.
Class Method Details
.run ⇒ Object
17 18 19 |
# File 'lib/online_migrations/background_schema_migrations/scheduler.rb', line 17 def self.run new.run end |
Instance Method Details
#run ⇒ Object
Runs Scheduler
22 23 24 25 26 27 28 |
# File 'lib/online_migrations/background_schema_migrations/scheduler.rb', line 22 def run migration = find_migration if migration runner = MigrationRunner.new(migration) runner.run end end |