redis-client 0.18.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +3 -3
- 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: 1dfa2a6fb000223a3150caeffa1f5341e322b436128dc0cdb0b22998586e1a56
|
4
|
+
data.tar.gz: cc8cd32d6036a00710b5d0dc728382c7be48e58fcbc07759d392267cf9a6397b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69f9ba83f34836944c0af218f1dd117c76d6f4a09a5aeee001727b19ac01013e1bb3ba308386690a34960282153d4075cd7949fc7b0a25c89840b82eceb5dbdf
|
7
|
+
data.tar.gz: 54d85162e372c33756adf4af7da1f0abe3d0cd4789336d678a1fc4a37afac749c929d7032a58d3e92f3576ed1001c3ec60bd15670762dc2553a69744891a3b06
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
redis-client (0.
|
4
|
+
redis-client (0.19.0)
|
5
5
|
connection_pool
|
6
6
|
|
7
7
|
GEM
|
@@ -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.0
|
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-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|