Sha256: 2e64bfb3b5e8a1aeb766b43e7d9d7cfec38caa24e6833e3bf416c96784bf8319
Contents?: true
Size: 380 Bytes
Versions: 12
Compression:
Stored size: 380 Bytes
Contents
module ActiveRecord::ConnectionAdapters class MysqlAdapter < AbstractAdapter TIMEOUT=5 def locked(lock, opts = {}) lock = "#{current_database}.rails.#{lock}" begin execute "SELECT GET_LOCK(#{quote(lock)},#{opts[:timeout] || TIMEOUT})" yield ensure execute "SELECT RELEASE_LOCK(#{quote(lock)})" end end end end
Version data entries
12 entries across 12 versions & 1 rubygems