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.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/gitlab/database/migrations/lock_retry_mixin.rb', line 36 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 |