redis 4.0.3 → 4.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -4
- data/lib/redis.rb +6 -2
- data/lib/redis/client.rb +6 -11
- data/lib/redis/version.rb +1 -1
- data/redis.gemspec +1 -2
- data/test/helper.rb +0 -1
- data/test/internals_test.rb +0 -13
- metadata +6 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07e1a92f8c30f083ff776facb54362ff789e63a4
|
4
|
+
data.tar.gz: bf5cb573dcfb6c37f68bf9f903a161aec41ef8e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afcd92eef3e98a0af75d7a9a850a6a44f133eae9fc84c6b83f2790eed9784445e738fac4174f814b72c45e137d257da362868b081a7ab1ef901e50d07196a4ed
|
7
|
+
data.tar.gz: e933241b40c387e8bd3c702ceaee786b7b82e4baa8428be0255f99f6e3039ef9d4c8b3f2e68da0e7f823c70364ea662b6171fb95681b125b9990a3435ceab898
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# 4.0.
|
1
|
+
# 4.1.0.beta1
|
2
2
|
|
3
|
-
*
|
4
|
-
* Fix the gemspec to stop exposing a `build` executable. See #785.
|
5
|
-
* Add `:reconnect_delay` and `:reconnect_delay_max` options. See #778.
|
3
|
+
* Added Redis Cluster support. See #716.
|
6
4
|
|
7
5
|
# 4.0.2
|
8
6
|
|
data/lib/redis.rb
CHANGED
@@ -2936,8 +2936,12 @@ private
|
|
2936
2936
|
|
2937
2937
|
FloatifyPairs =
|
2938
2938
|
lambda { |result|
|
2939
|
-
result.each_slice
|
2940
|
-
|
2939
|
+
if result.respond_to?(:each_slice)
|
2940
|
+
result.each_slice(2).map do |member, score|
|
2941
|
+
[member, Floatify.call(score)]
|
2942
|
+
end
|
2943
|
+
else
|
2944
|
+
result
|
2941
2945
|
end
|
2942
2946
|
}
|
2943
2947
|
|
data/lib/redis/client.rb
CHANGED
@@ -18,8 +18,6 @@ class Redis
|
|
18
18
|
:id => nil,
|
19
19
|
:tcp_keepalive => 0,
|
20
20
|
:reconnect_attempts => 1,
|
21
|
-
:reconnect_delay => 0,
|
22
|
-
:reconnect_delay_max => 0.5,
|
23
21
|
:inherit_socket => false
|
24
22
|
}
|
25
23
|
|
@@ -191,10 +189,13 @@ class Redis
|
|
191
189
|
exception = nil
|
192
190
|
|
193
191
|
process(commands) do
|
194
|
-
|
192
|
+
result[0] = read
|
193
|
+
|
194
|
+
@reconnect = false
|
195
|
+
|
196
|
+
(commands.size - 1).times do |i|
|
195
197
|
reply = read
|
196
|
-
result[i] = reply
|
197
|
-
@reconnect = false
|
198
|
+
result[i + 1] = reply
|
198
199
|
exception = reply if exception.nil? && reply.is_a?(CommandError)
|
199
200
|
end
|
200
201
|
end
|
@@ -374,10 +375,6 @@ class Redis
|
|
374
375
|
disconnect
|
375
376
|
|
376
377
|
if attempts <= @options[:reconnect_attempts] && @reconnect
|
377
|
-
sleep_t = [(@options[:reconnect_delay] * 2**(attempts-1)),
|
378
|
-
@options[:reconnect_delay_max]].min
|
379
|
-
|
380
|
-
Kernel.sleep(sleep_t)
|
381
378
|
retry
|
382
379
|
else
|
383
380
|
raise
|
@@ -455,8 +452,6 @@ class Redis
|
|
455
452
|
options[:write_timeout] = Float(options[:write_timeout])
|
456
453
|
|
457
454
|
options[:reconnect_attempts] = options[:reconnect_attempts].to_i
|
458
|
-
options[:reconnect_delay] = options[:reconnect_delay].to_f
|
459
|
-
options[:reconnect_delay_max] = options[:reconnect_delay_max].to_f
|
460
455
|
|
461
456
|
options[:db] = options[:db].to_i
|
462
457
|
options[:driver] = _parse_driver(options[:driver]) || Connection.drivers.last
|
data/lib/redis/version.rb
CHANGED
data/redis.gemspec
CHANGED
@@ -32,12 +32,11 @@ Gem::Specification.new do |s|
|
|
32
32
|
|
33
33
|
s.files = `git ls-files`.split("\n")
|
34
34
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
35
|
-
s.executables = `git ls-files --
|
35
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
36
36
|
|
37
37
|
s.required_ruby_version = '>= 2.2.2'
|
38
38
|
|
39
39
|
s.add_development_dependency("test-unit", ">= 3.1.5")
|
40
|
-
s.add_development_dependency("mocha")
|
41
40
|
s.add_development_dependency("hiredis")
|
42
41
|
s.add_development_dependency("em-synchrony")
|
43
42
|
end
|
data/test/helper.rb
CHANGED
data/test/internals_test.rb
CHANGED
@@ -202,19 +202,6 @@ class TestInternals < Test::Unit::TestCase
|
|
202
202
|
end
|
203
203
|
end
|
204
204
|
|
205
|
-
def test_retry_with_custom_reconnect_attempts_and_exponential_backoff
|
206
|
-
close_on_ping([0, 1, 2], :reconnect_attempts => 3,
|
207
|
-
:reconnect_delay_max => 0.5,
|
208
|
-
:reconnect_delay => 0.01) do |redis|
|
209
|
-
|
210
|
-
Kernel.expects(:sleep).with(0.01).returns(true)
|
211
|
-
Kernel.expects(:sleep).with(0.02).returns(true)
|
212
|
-
Kernel.expects(:sleep).with(0.04).returns(true)
|
213
|
-
|
214
|
-
assert_equal "3", redis.ping
|
215
|
-
end
|
216
|
-
end
|
217
|
-
|
218
205
|
def test_don_t_retry_when_second_read_in_pipeline_raises_econnreset
|
219
206
|
close_on_ping([1]) do |redis|
|
220
207
|
assert_raise Redis::ConnectionError do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.1.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezra Zygmuntowicz
|
@@ -16,7 +16,7 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2018-
|
19
|
+
date: 2018-08-13 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: test-unit
|
@@ -32,20 +32,6 @@ dependencies:
|
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: 3.1.5
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: mocha
|
37
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '0'
|
42
|
-
type: :development
|
43
|
-
prerelease: false
|
44
|
-
version_requirements: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - ">="
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '0'
|
49
35
|
- !ruby/object:Gem::Dependency
|
50
36
|
name: hiredis
|
51
37
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,7 +65,8 @@ description: |2
|
|
79
65
|
providing an idiomatic interface.
|
80
66
|
email:
|
81
67
|
- redis-db@googlegroups.com
|
82
|
-
executables:
|
68
|
+
executables:
|
69
|
+
- build
|
83
70
|
extensions: []
|
84
71
|
extra_rdoc_files: []
|
85
72
|
files:
|
@@ -256,9 +243,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
256
243
|
version: 2.2.2
|
257
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
258
245
|
requirements:
|
259
|
-
- - "
|
246
|
+
- - ">"
|
260
247
|
- !ruby/object:Gem::Version
|
261
|
-
version:
|
248
|
+
version: 1.3.1
|
262
249
|
requirements: []
|
263
250
|
rubyforge_project:
|
264
251
|
rubygems_version: 2.5.1
|