robust-redis-lock 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redis-lock.rb +11 -7
- data/lib/robust-redis-lock/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e91ccab46ae6e04e6927f8b36e49f42a730500b
|
4
|
+
data.tar.gz: 5e13ddaa92cece6db205b083159176827cdb4ae0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 807017173ce61abce329aa966eac6f965390ff3e90026139efd93d302e47f3744af2e4b32da10989f0ce851535fe04753ed9df50e35c30a53173766527d2c634
|
7
|
+
data.tar.gz: 4569677ed33d4c4473d480e51874191621f1184c075b92b7384f265ceefa0249a711802087f866fd801a45fa8d5874625456394cc5dd4f4eb61a088d8ef759a6
|
data/lib/redis-lock.rb
CHANGED
@@ -60,13 +60,17 @@ class Redis::Lock
|
|
60
60
|
@token = @options[:token]
|
61
61
|
end
|
62
62
|
|
63
|
-
def synchronize
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
63
|
+
def synchronize
|
64
|
+
begin
|
65
|
+
lock
|
66
|
+
rescue Recovered
|
67
|
+
end
|
68
|
+
|
69
|
+
begin
|
70
|
+
yield
|
71
|
+
ensure
|
72
|
+
unlock
|
73
|
+
end
|
70
74
|
end
|
71
75
|
|
72
76
|
def lock(options={})
|