Module: Gitlab::Database::Migrations::LockRetryMixin::ActiveRecordMigratorLockRetries
- Defined in:
- lib/gitlab/database/migrations/lock_retry_mixin.rb
Instance Method Summary collapse
-
#ddl_transaction(migration, &block) ⇒ Object
We patch the original method to start a transaction using the WithLockRetries methodology for the whole migration.
Instance Method Details
#ddl_transaction(migration, &block) ⇒ Object
We patch the original method to start a transaction using the WithLockRetries methodology for the whole migration.
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/gitlab/database/migrations/lock_retry_mixin.rb', line 44 def ddl_transaction(migration, &block) if use_transaction?(migration) migration.with_lock_retries_used! Gitlab::Database::WithLockRetries.new( connection: migration.migration_connection, klass: migration.migration_class, logger: Gitlab::BackgroundMigration::Logger ).run(raise_on_exhaustion: true, &block) else super end end |