3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/strong_migrations/migrator.rb', line 3
def ddl_transaction(migration, ...)
retries = StrongMigrations.lock_timeout_retries > 0 && use_transaction?(migration)
return super unless retries || StrongMigrations.transaction_timeout
migration = migration.send(:migration) if !migration.is_a?(ActiveRecord::Migration) && migration.respond_to?(:migration, true)
checker = migration.send(:strong_migrations_checker)
return super if checker.skip?
checker.set_transaction_timeout
return super unless retries
checker.retry_lock_timeouts(check_committed: true) do
checker.reset
super(migration, ...)
end
end
|