lock_key 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -130,13 +130,14 @@ class Redis
130
130
  _value_ = lock_value_for(key,opts)
131
131
  new_lock = _redis_.getset(_key_, _value_)
132
132
  got_lock = new_lock if i_have_the_lock?(new_lock)
133
+ elsif i_have_the_lock?(current_lock)
134
+ got_lock = current_lock
133
135
  end
134
136
  sleep opts[:sleep_for]
135
137
  end
136
138
 
137
139
  if !got_lock && opts[:raise]
138
- _value_ = lock_value_for(key, opts)
139
- raise LockAttemptTimeout, "Could not lock #{_value_}"
140
+ raise LockAttemptTimeout, "Could not lock #{key}"
140
141
  end
141
142
 
142
143
  got_lock
@@ -1,3 +1,3 @@
1
1
  module LockKey
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lock_key
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: