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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b51378548b60754d94665f9a037904b887b59e4
4
- data.tar.gz: 198d0fbd13843a382760e361172ee7f5eb33f378
3
+ metadata.gz: 3e91ccab46ae6e04e6927f8b36e49f42a730500b
4
+ data.tar.gz: 5e13ddaa92cece6db205b083159176827cdb4ae0
5
5
  SHA512:
6
- metadata.gz: adc3aa9d2ecf2bf7cc426d053a51cae9092e3d3e3634833974951a9fd9e5c9d58b2a6aaa4679f0cfedc0df7fec8d5cc73ee01ffe72d839c64bddcfcf59c43a5b
7
- data.tar.gz: e42dc101cc32ecd4a54523416ceb1fcdb8a37e7e2a3b370dfe80bb5ef32d1d984a037145b19defbd3b2bf78ac10eb9a6d95100068aab4833799b4f6f51377212
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(&block)
64
- lock
65
- block.call
66
- rescue Recovered
67
- block.call
68
- ensure
69
- try_unlock
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={})
@@ -1,5 +1,5 @@
1
1
  class Redis
2
2
  class Lock
3
- VERSION = '1.1.2'
3
+ VERSION = '1.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robust-redis-lock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kareem Kouddous