Sha256: ad78f3b06a07c1b1edfa2bef5439bf0c05789c724c6ab646a3044848e51a8f63
Contents?: true
Size: 434 Bytes
Versions: 32
Compression:
Stored size: 434 Bytes
Contents
# frozen_string_literal: true module Sequel::Plugins::WithLock module InstanceMethods # Execute block with lock # # @yield def with_lock(mode = "FOR NO KEY UPDATE", savepoint: true) return yield if @__locked @__locked = true begin db.transaction(savepoint: savepoint) do lock!(mode) yield end ensure @__locked = false end end end end
Version data entries
32 entries across 32 versions & 1 rubygems