redis-client 0.18.0 → 0.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +4 -4
- data/lib/redis_client/config.rb +6 -1
- data/lib/redis_client/ruby_connection.rb +1 -0
- data/lib/redis_client/version.rb +1 -1
- data/lib/redis_client.rb +9 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 920d97dcf258796ba88bb2f087fa89c1595dd245f67292c7432893848baacd0b
|
4
|
+
data.tar.gz: 07151d3aa036f7c513e7baa2cc94c22a7f9b4af8a09e132b1943716cd458c408
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f664cf2c5fe77115606dc15e031e6bccc55c440b55d521ef5429653acb89bf55597dd4e5cd4892fb61f9452790a2ca41e32e72c6f824c7da9609987b14ff42
|
7
|
+
data.tar.gz: c6a34fe93aac6d5ae5c8995881e17581e64a762d0fdc3d3fe1772b07b1759196b2ca5a27e14e00c826399d03a1259f799c816ac1ca1ee001314d9b32f341ecb8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# 0.19.1
|
4
|
+
|
5
|
+
- Fixed a bug in `hiredis-client` that could cause a crash if interrupted by `Timeout.timeout` or other `Thread#raise` based mecanism.
|
6
|
+
- Fixed a GC bug that could cause crashes in `hiredis-client`.
|
7
|
+
|
8
|
+
# 0.19.0
|
9
|
+
|
10
|
+
- Revalidate connection in `RedisClient#connected?`
|
11
|
+
- Eagerly fail if `db:` isn't an Integer. #151.
|
12
|
+
|
3
13
|
# 0.18.0
|
4
14
|
|
5
15
|
- Expose more connection details such as `host`, `db`, etc on `RedisClient`.
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
redis-client (0.
|
4
|
+
redis-client (0.19.1)
|
5
5
|
connection_pool
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
ast (2.4.2)
|
11
|
-
benchmark-ips (2.
|
11
|
+
benchmark-ips (2.13.0)
|
12
12
|
byebug (11.1.3)
|
13
13
|
connection_pool (2.4.1)
|
14
14
|
hiredis (0.6.3)
|
@@ -18,7 +18,7 @@ GEM
|
|
18
18
|
parser (3.1.2.1)
|
19
19
|
ast (~> 2.4.1)
|
20
20
|
rainbow (3.1.1)
|
21
|
-
rake (13.0
|
21
|
+
rake (13.1.0)
|
22
22
|
rake-compiler (1.2.5)
|
23
23
|
rake
|
24
24
|
redis (4.6.0)
|
@@ -53,7 +53,7 @@ DEPENDENCIES
|
|
53
53
|
byebug
|
54
54
|
hiredis
|
55
55
|
minitest
|
56
|
-
rake (~> 13.
|
56
|
+
rake (~> 13.1)
|
57
57
|
rake-compiler
|
58
58
|
redis (~> 4.6)
|
59
59
|
redis-client!
|
data/lib/redis_client/config.rb
CHANGED
@@ -41,7 +41,12 @@ class RedisClient
|
|
41
41
|
)
|
42
42
|
@username = username
|
43
43
|
@password = password
|
44
|
-
@db =
|
44
|
+
@db = begin
|
45
|
+
Integer(db || DEFAULT_DB)
|
46
|
+
rescue ArgumentError
|
47
|
+
raise ArgumentError, "db: must be an Integer, got: #{db.inspect}"
|
48
|
+
end
|
49
|
+
|
45
50
|
@id = id
|
46
51
|
@ssl = ssl || false
|
47
52
|
|
data/lib/redis_client/version.rb
CHANGED
data/lib/redis_client.rb
CHANGED
@@ -222,17 +222,18 @@ class RedisClient
|
|
222
222
|
|
223
223
|
def timeout=(timeout)
|
224
224
|
super
|
225
|
-
raw_connection
|
225
|
+
@raw_connection&.read_timeout = timeout
|
226
|
+
@raw_connection&.write_timeout = timeout
|
226
227
|
end
|
227
228
|
|
228
229
|
def read_timeout=(timeout)
|
229
230
|
super
|
230
|
-
raw_connection
|
231
|
+
@raw_connection&.read_timeout = timeout
|
231
232
|
end
|
232
233
|
|
233
234
|
def write_timeout=(timeout)
|
234
235
|
super
|
235
|
-
raw_connection
|
236
|
+
@raw_connection&.write_timeout = timeout
|
236
237
|
end
|
237
238
|
|
238
239
|
def pubsub
|
@@ -386,7 +387,7 @@ class RedisClient
|
|
386
387
|
end
|
387
388
|
|
388
389
|
def connected?
|
389
|
-
@raw_connection&.
|
390
|
+
@raw_connection&.revalidate
|
390
391
|
end
|
391
392
|
|
392
393
|
def close
|
@@ -669,6 +670,7 @@ class RedisClient
|
|
669
670
|
elsif retryable
|
670
671
|
tries = 0
|
671
672
|
connection = nil
|
673
|
+
preferred_error = nil
|
672
674
|
begin
|
673
675
|
connection = raw_connection
|
674
676
|
if block_given?
|
@@ -677,13 +679,15 @@ class RedisClient
|
|
677
679
|
connection
|
678
680
|
end
|
679
681
|
rescue ConnectionError, ProtocolError => error
|
682
|
+
preferred_error ||= error
|
683
|
+
preferred_error = error unless error.is_a?(CircuitBreaker::OpenCircuitError)
|
680
684
|
close
|
681
685
|
|
682
686
|
if !@disable_reconnection && config.retry_connecting?(tries, error)
|
683
687
|
tries += 1
|
684
688
|
retry
|
685
689
|
else
|
686
|
-
raise
|
690
|
+
raise preferred_error
|
687
691
|
end
|
688
692
|
end
|
689
693
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Boussier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|