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 +5 -5
- data/Makefile +5 -0
- data/README.md +1 -1
- data/lib/redlock/client.rb +1 -3
- data/lib/redlock/version.rb +1 -1
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '09e97229d3f4d001a612e97e6c76a7855a7186ec612afaee0d6e7b1dc5fd2cfc'
|
4
|
+
data.tar.gz: ad13c6b86a28eaba8359729b9f857c147610dbac0bb272613e2950b6c5adbee8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb58e84074840f2a08ce2b6d53385ec86faf3a94a1579b4ca3477278a7ba95bbd3ffaeff5adaadc4d3515c84f97659a45177393c1e6ebda13ef9458dd28eae06
|
7
|
+
data.tar.gz: 6a5a52c8d48cb09f64bb071dccda4518bdc0e07ddea596ac152a6ed52ff6fdf473de6565ce68ecbf4077008acc289c32eeda41d4617ec9370d5e2cabada86f2d
|
data/Makefile
CHANGED
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" ])
|
data/lib/redlock/client.rb
CHANGED
@@ -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::
|
127
|
+
rescue Redis::BaseConnectionError
|
130
128
|
false
|
131
129
|
end
|
132
130
|
|
data/lib/redlock/version.rb
CHANGED
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.
|
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:
|
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
|
-
|
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.
|