Sha256: 375c466775e2fa8546afaf8ffcbd0e80de6edbdf6df3f72b528e90302956ac62

Contents?: true

Size: 425 Bytes

Versions: 2

Compression:

Stored size: 425 Bytes

Contents

module MigrationLockTimeout
  module LockManager

    def migrate(direction)
      timeout_disabled = self.class.disable_lock_timeout
      time = self.class.lock_timeout_override || 
        MigrationLockTimeout.try(:config).try(:default_timeout)
      if !timeout_disabled && direction == :up && time && !disable_ddl_transaction
        execute "SET LOCAL lock_timeout = '#{time}s'"
      end
      super
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
migration-lock-timeout-1.1.0 lib/migration_lock_timeout/lock_manager.rb
migration-lock-timeout-1.0.0 lib/migration_lock_timeout/lock_manager.rb