redis 4.1.2 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/README.md +5 -0
- data/lib/redis.rb +5 -5
- data/lib/redis/cluster.rb +3 -0
- data/lib/redis/connection/ruby.rb +12 -1
- data/lib/redis/distributed.rb +8 -5
- data/lib/redis/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 435d4e9027443183a1003530b77bf10e56240d22ae4726964431c910c31400c9
|
4
|
+
data.tar.gz: 57c0a429e09e618bc2694a5b32a0723c368088c0b143012d8a42c5eb85777909
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c82aea61505847b13583c327ca0437564111153a0d37455f294feb8c87f885582589b17f638409553e174b790b5898e42ab79a3e09ab4ebf607a6a5f8205f3da
|
7
|
+
data.tar.gz: 9edffdf06ee68e7a216f34a30bd7e3203188f4b1cbda4c9976ff616edb0839a46e4935830165545a4829d9aed80345d5145dcdf92fa87d9dcffe8094fb70f0ce
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
-
# 4.1.
|
3
|
+
# 4.1.3
|
4
4
|
|
5
5
|
* Fix the client hanging forever when connecting with SSL to a non-SSL server. See #835.
|
6
|
+
|
7
|
+
# 4.1.2
|
8
|
+
|
6
9
|
* Fix several authentication problems with sentinel. See #850 and #856.
|
7
10
|
* Explicitly drop Ruby 2.2 support.
|
8
11
|
|
data/README.md
CHANGED
@@ -142,6 +142,7 @@ redis.mget('{key}1', '{key}2')
|
|
142
142
|
```
|
143
143
|
|
144
144
|
* The client automatically reconnects after a failover occurred, but the caller is responsible for handling errors while it is happening.
|
145
|
+
* The client support permanent node failures, and will reroute requests to promoted slaves.
|
145
146
|
* The client supports `MOVED` and `ASK` redirections transparently.
|
146
147
|
|
147
148
|
## Storing objects
|
@@ -436,6 +437,10 @@ redis = Redis.new(:driver => :synchrony)
|
|
436
437
|
This library is tested against recent Ruby and Redis versions.
|
437
438
|
Check [Travis][travis-link] for the exact versions supported.
|
438
439
|
|
440
|
+
## See Also
|
441
|
+
|
442
|
+
- [async-redis](https://github.com/socketry/async-redis) — An [async](https://github.com/socketry/async) compatible Redis client.
|
443
|
+
|
439
444
|
## Contributors
|
440
445
|
|
441
446
|
Several people contributed to redis-rb, but we would like to especially
|
data/lib/redis.rb
CHANGED
@@ -1164,21 +1164,21 @@ class Redis
|
|
1164
1164
|
end
|
1165
1165
|
|
1166
1166
|
def _bpop(cmd, args, &blk)
|
1167
|
-
|
1168
|
-
|
1169
|
-
if args.last.is_a?(Hash)
|
1167
|
+
timeout = if args.last.is_a?(Hash)
|
1170
1168
|
options = args.pop
|
1169
|
+
options[:timeout]
|
1171
1170
|
elsif args.last.respond_to?(:to_int)
|
1172
1171
|
# Issue deprecation notice in obnoxious mode...
|
1173
|
-
|
1172
|
+
args.pop.to_int
|
1174
1173
|
end
|
1175
1174
|
|
1175
|
+
timeout ||= 0
|
1176
|
+
|
1176
1177
|
if args.size > 1
|
1177
1178
|
# Issue deprecation notice in obnoxious mode...
|
1178
1179
|
end
|
1179
1180
|
|
1180
1181
|
keys = args.flatten
|
1181
|
-
timeout = options[:timeout] || 0
|
1182
1182
|
|
1183
1183
|
synchronize do |client|
|
1184
1184
|
command = [cmd, keys, timeout]
|
data/lib/redis/cluster.rb
CHANGED
@@ -289,7 +289,7 @@ class Redis
|
|
289
289
|
end
|
290
290
|
end
|
291
291
|
|
292
|
-
unless ctx.verify_mode == OpenSSL::SSL::VERIFY_NONE
|
292
|
+
unless ctx.verify_mode == OpenSSL::SSL::VERIFY_NONE || (ctx.respond_to?(:verify_hostname) && !ctx.verify_hostname)
|
293
293
|
ssl_sock.post_connection_check(host)
|
294
294
|
end
|
295
295
|
|
@@ -321,6 +321,7 @@ class Redis
|
|
321
321
|
instance.timeout = config[:read_timeout]
|
322
322
|
instance.write_timeout = config[:write_timeout]
|
323
323
|
instance.set_tcp_keepalive config[:tcp_keepalive]
|
324
|
+
instance.set_tcp_nodelay if sock.is_a? TCPSocket
|
324
325
|
instance
|
325
326
|
end
|
326
327
|
|
@@ -351,6 +352,16 @@ class Redis
|
|
351
352
|
end
|
352
353
|
end
|
353
354
|
|
355
|
+
# disables Nagle's Algorithm, prevents multiple round trips with MULTI
|
356
|
+
if [:IPPROTO_TCP, :TCP_NODELAY].all?{|c| Socket.const_defined? c}
|
357
|
+
def set_tcp_nodelay
|
358
|
+
@sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
|
359
|
+
end
|
360
|
+
else
|
361
|
+
def set_tcp_nodelay
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
354
365
|
def initialize(sock)
|
355
366
|
@sock = sock
|
356
367
|
end
|
data/lib/redis/distributed.rb
CHANGED
@@ -401,13 +401,12 @@ class Redis
|
|
401
401
|
end
|
402
402
|
|
403
403
|
def _bpop(cmd, args)
|
404
|
-
|
405
|
-
|
406
|
-
if args.last.is_a?(Hash)
|
404
|
+
timeout = if args.last.is_a?(Hash)
|
407
405
|
options = args.pop
|
406
|
+
options[:timeout]
|
408
407
|
elsif args.last.respond_to?(:to_int)
|
409
408
|
# Issue deprecation notice in obnoxious mode...
|
410
|
-
|
409
|
+
args.pop.to_int
|
411
410
|
end
|
412
411
|
|
413
412
|
if args.size > 1
|
@@ -417,7 +416,11 @@ class Redis
|
|
417
416
|
keys = args.flatten
|
418
417
|
|
419
418
|
ensure_same_node(cmd, keys) do |node|
|
420
|
-
|
419
|
+
if timeout
|
420
|
+
node.__send__(cmd, keys, timeout: timeout)
|
421
|
+
else
|
422
|
+
node.__send__(cmd, keys)
|
423
|
+
end
|
421
424
|
end
|
422
425
|
end
|
423
426
|
|
data/lib/redis/version.rb
CHANGED
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.1.
|
4
|
+
version: 4.1.3
|
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: 2019-
|
19
|
+
date: 2019-09-17 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: mocha
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
|
-
rubygems_version: 3.0.
|
118
|
+
rubygems_version: 3.0.4
|
119
119
|
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: A Ruby client library for Redis
|