redlock 1.0.0 → 1.0.1

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
- SHA1:
3
- metadata.gz: 12311731641f60b7873ced7fcb039d073fc21525
4
- data.tar.gz: 58bc941bc7bbebc10b3fcc32a32e970c3abcefe8
2
+ SHA256:
3
+ metadata.gz: '09e97229d3f4d001a612e97e6c76a7855a7186ec612afaee0d6e7b1dc5fd2cfc'
4
+ data.tar.gz: ad13c6b86a28eaba8359729b9f857c147610dbac0bb272613e2950b6c5adbee8
5
5
  SHA512:
6
- metadata.gz: 719b17fb2701e48d3f574f198bafd078fd0f9b6ec91f686e4ece547e222c1b4bf09f5ee94868f1d1417c2e6c87d5c3b4742a185c13bb005fc83d868b2b5d0bc1
7
- data.tar.gz: cc759db7fe3ba5f8cf09f1f1427564d1c338a97dc1959304e7fdc561f2817e5f133a54b381382ca1b96712e3109f41247ffa5da4a40bf6fd05a8bfb2d875832b
6
+ metadata.gz: cb58e84074840f2a08ce2b6d53385ec86faf3a94a1579b4ca3477278a7ba95bbd3ffaeff5adaadc4d3515c84f97659a45177393c1e6ebda13ef9458dd28eae06
7
+ data.tar.gz: 6a5a52c8d48cb09f64bb071dccda4518bdc0e07ddea596ac152a6ed52ff6fdf473de6565ce68ecbf4077008acc289c32eeda41d4617ec9370d5e2cabada86f2d
data/Makefile CHANGED
@@ -2,3 +2,8 @@ default: test
2
2
  test:
3
3
  docker-compose run --rm test
4
4
 
5
+ build:
6
+ docker-compose run --rm test gem build redlock.gemspec
7
+
8
+ publish:
9
+ docker-compose run --rm test gem push `ls -lt *gem | head -n 1 | awk '{ print $$9 }'`
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
  [![Build Status](https://travis-ci.org/leandromoreira/redlock-rb.svg?branch=master)](https://travis-ci.org/leandromoreira/redlock-rb)
3
3
  [![Coverage Status](https://coveralls.io/repos/leandromoreira/redlock-rb/badge.svg?branch=master)](https://coveralls.io/r/leandromoreira/redlock-rb?branch=master)
4
4
  [![Code Climate](https://codeclimate.com/github/leandromoreira/redlock-rb/badges/gpa.svg)](https://codeclimate.com/github/leandromoreira/redlock-rb)
5
- [![Dependency Status](https://gemnasium.com/leandromoreira/redlock-rb.svg)](https://gemnasium.com/leandromoreira/redlock-rb)
6
5
  [![Gem Version](https://badge.fury.io/rb/redlock.svg)](http://badge.fury.io/rb/redlock)
7
6
  [![security](https://hakiri.io/github/leandromoreira/redlock-rb/master.svg)](https://hakiri.io/github/leandromoreira/redlock-rb/master)
8
7
  [![Inline docs](http://inch-ci.org/github/leandromoreira/redlock-rb.svg?branch=master)](http://inch-ci.org/github/leandromoreira/redlock-rb)
@@ -45,6 +44,7 @@ Or install it yourself as:
45
44
 
46
45
  ### Acquiring a lock
47
46
 
47
+ NOTE: All expiration durations are in milliseconds.
48
48
  ```ruby
49
49
  # Locking
50
50
  lock_manager = Redlock::Client.new([ "redis://127.0.0.1:7777", "redis://127.0.0.1:7778", "redis://127.0.0.1:7779" ])
@@ -118,15 +118,13 @@ module Redlock
118
118
  else
119
119
  @redis = Redis.new(connection)
120
120
  end
121
-
122
- load_scripts
123
121
  end
124
122
 
125
123
  def lock(resource, val, ttl, allow_new_lock)
126
124
  recover_from_script_flush do
127
125
  @redis.evalsha @lock_script_sha, keys: [resource], argv: [val, ttl, allow_new_lock]
128
126
  end
129
- rescue Redis::CannotConnectError
127
+ rescue Redis::BaseConnectionError
130
128
  false
131
129
  end
132
130
 
@@ -1,3 +1,3 @@
1
1
  module Redlock
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redlock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Moreira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-11 00:00:00.000000000 Z
11
+ date: 2019-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -68,22 +68,22 @@ dependencies:
68
68
  name: rspec
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - "~>"
72
- - !ruby/object:Gem::Version
73
- version: '3'
74
71
  - - ">="
75
72
  - !ruby/object:Gem::Version
76
73
  version: 3.0.0
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '3'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '3'
84
81
  - - ">="
85
82
  - !ruby/object:Gem::Version
86
83
  version: 3.0.0
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: '3'
87
87
  description: Distributed lock using Redis written in Ruby. Highly inspired by https://github.com/antirez/redlock-rb.
88
88
  email:
89
89
  - leandro.ribeiro.moreira@gmail.com
@@ -130,8 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []
133
- rubyforge_project:
134
- rubygems_version: 2.5.2.3
133
+ rubygems_version: 3.0.3
135
134
  signing_key:
136
135
  specification_version: 4
137
136
  summary: Distributed lock using Redis written in Ruby.