lib/redlock/testing.rb in seamusabshere-redlock-1.0.0 vs lib/redlock/testing.rb in seamusabshere-redlock-1.0.1
- old
+ new
@@ -7,10 +7,10 @@
def try_lock_instances(resource, ttl, extend)
if @testing_mode == :bypass
{
validity: ttl,
resource: resource,
- value: SecureRandom.uuid
+ value: extend ? extend.fetch(:value) : SecureRandom.uuid
}
elsif @testing_mode == :fail
false
else
try_lock_instances_without_testing resource, ttl, extend