method

with_advisory_lock

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: ActiveRecord::Migrator
with_advisory_lock() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/migration.rb, line 1293
    def with_advisory_lock
      lock_id = generate_migrator_advisory_lock_id
      got_lock = Base.connection.get_advisory_lock(lock_id)
      raise ConcurrentMigrationError unless got_lock
      load_migrated # reload schema_migrations to be sure it wasn't changed by another process before we got the lock
      yield
    ensure
      Base.connection.release_advisory_lock(lock_id) if got_lock
    end
Register or log in to add new notes.