lib/sequel/plugins/with_lock.rb in umbrellio-sequel-plugins-0.5.0 vs lib/sequel/plugins/with_lock.rb in umbrellio-sequel-plugins-0.5.1
- old
+ new
@@ -3,15 +3,15 @@
module Sequel::Plugins::WithLock
module InstanceMethods
# Execute block with lock
#
# @yield
- def with_lock
+ def with_lock(savepoint: true)
return yield if @__locked
@__locked = true
begin
- db.transaction do
+ db.transaction(savepoint: savepoint) do
lock!
yield
end
ensure
@__locked = false