redis-client 0.7.1 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +12 -12
- data/lib/redis_client/config.rb +2 -1
- data/lib/redis_client/version.rb +1 -1
- data/lib/redis_client.rb +16 -3
- 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: e6fbe9260e43212ff9c501d95cf262f0c34e4db3cbc4dc6bebef3e8d2f98fc52
|
|
4
|
+
data.tar.gz: d8356c2d342ae51f70e33b28f5e5679bea021ed31240b35c055ea5ad5625e9a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7ad5fdf44a060e90f3d9a4b350733d208a745e625fa95764c7288047bfa4138e9e882a6608634374c66b3fa595037d8603eb902f431603c8c94048bacfbf8184
|
|
7
|
+
data.tar.gz: c09bea07473c08a6d67b0615811484e50199da37ceb25a977129f616595fc7692d24aa46851272129b4a41c735f83a22dae0922a09bc74f6be72fe28dda2576d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Unreleased
|
|
2
2
|
|
|
3
|
+
# 0.7.4
|
|
4
|
+
|
|
5
|
+
- Properly parse script errors on pre 7.0 redis server.
|
|
6
|
+
|
|
7
|
+
# 0.7.3
|
|
8
|
+
|
|
9
|
+
- Fix a bug in `url` parsing conflicting with the `path` option.
|
|
10
|
+
|
|
11
|
+
# 0.7.2
|
|
12
|
+
|
|
13
|
+
- Raise a distinct `RedisClient::OutOfMemoryError`, for Redis `OOM` errors.
|
|
14
|
+
- Fix the instrumentation API to be called even for authentication commands.
|
|
15
|
+
- Fix `url:` configuration to accept a trailing slash.
|
|
16
|
+
|
|
3
17
|
# 0.7.1
|
|
4
18
|
|
|
5
19
|
- Fix `#pubsub` being called when reconnection is disabled (redis-rb compatibility fix).
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
redis-client (0.7.
|
|
4
|
+
redis-client (0.7.4)
|
|
5
5
|
connection_pool
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -14,33 +14,33 @@ GEM
|
|
|
14
14
|
hiredis (0.6.3)
|
|
15
15
|
hiredis (0.6.3-java)
|
|
16
16
|
minitest (5.15.0)
|
|
17
|
-
parallel (1.
|
|
18
|
-
parser (3.1.1
|
|
17
|
+
parallel (1.22.1)
|
|
18
|
+
parser (3.1.2.1)
|
|
19
19
|
ast (~> 2.4.1)
|
|
20
20
|
rainbow (3.1.1)
|
|
21
21
|
rake (13.0.6)
|
|
22
|
-
rake-compiler (1.
|
|
22
|
+
rake-compiler (1.2.0)
|
|
23
23
|
rake
|
|
24
24
|
redis (4.6.0)
|
|
25
|
-
regexp_parser (2.
|
|
25
|
+
regexp_parser (2.5.0)
|
|
26
26
|
rexml (3.2.5)
|
|
27
|
-
rubocop (1.
|
|
27
|
+
rubocop (1.28.2)
|
|
28
28
|
parallel (~> 1.10)
|
|
29
29
|
parser (>= 3.1.0.0)
|
|
30
30
|
rainbow (>= 2.2.2, < 4.0)
|
|
31
31
|
regexp_parser (>= 1.8, < 3.0)
|
|
32
32
|
rexml
|
|
33
|
-
rubocop-ast (>= 1.
|
|
33
|
+
rubocop-ast (>= 1.17.0, < 2.0)
|
|
34
34
|
ruby-progressbar (~> 1.7)
|
|
35
35
|
unicode-display_width (>= 1.4.0, < 3.0)
|
|
36
|
-
rubocop-ast (1.
|
|
36
|
+
rubocop-ast (1.17.0)
|
|
37
37
|
parser (>= 3.1.1.0)
|
|
38
|
-
rubocop-minitest (0.
|
|
38
|
+
rubocop-minitest (0.19.1)
|
|
39
39
|
rubocop (>= 0.90, < 2.0)
|
|
40
40
|
ruby-progressbar (1.11.0)
|
|
41
|
-
stackprof (0.2.
|
|
42
|
-
toxiproxy (2.0.
|
|
43
|
-
unicode-display_width (2.
|
|
41
|
+
stackprof (0.2.21)
|
|
42
|
+
toxiproxy (2.0.2)
|
|
43
|
+
unicode-display_width (2.2.0)
|
|
44
44
|
|
|
45
45
|
PLATFORMS
|
|
46
46
|
ruby
|
data/lib/redis_client/config.rb
CHANGED
|
@@ -149,7 +149,8 @@ class RedisClient
|
|
|
149
149
|
URI.decode_www_form_component(uri.password)
|
|
150
150
|
end
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
db_path = uri.path&.delete_prefix("/")
|
|
153
|
+
kwargs[:db] ||= Integer(db_path) if db_path && !db_path.empty?
|
|
153
154
|
end
|
|
154
155
|
|
|
155
156
|
super(**kwargs)
|
data/lib/redis_client/version.rb
CHANGED
data/lib/redis_client.rb
CHANGED
|
@@ -94,7 +94,14 @@ class RedisClient
|
|
|
94
94
|
|
|
95
95
|
class << self
|
|
96
96
|
def parse(error_message)
|
|
97
|
-
code = error_message.
|
|
97
|
+
code = if error_message.start_with?("ERR Error running script")
|
|
98
|
+
# On older redis servers script errors are nested.
|
|
99
|
+
# So we need to parse some more.
|
|
100
|
+
if (match = error_message.match(/:\s-([A-Z]+) /))
|
|
101
|
+
match[1]
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
code ||= error_message.split(' ', 2).first
|
|
98
105
|
klass = ERRORS.fetch(code, self)
|
|
99
106
|
klass.new(error_message)
|
|
100
107
|
end
|
|
@@ -109,12 +116,14 @@ class RedisClient
|
|
|
109
116
|
PermissionError = Class.new(CommandError)
|
|
110
117
|
ReadOnlyError = Class.new(CommandError)
|
|
111
118
|
WrongTypeError = Class.new(CommandError)
|
|
119
|
+
OutOfMemoryError = Class.new(CommandError)
|
|
112
120
|
|
|
113
121
|
CommandError::ERRORS = {
|
|
114
122
|
"WRONGPASS" => AuthenticationError,
|
|
115
123
|
"NOPERM" => PermissionError,
|
|
116
124
|
"READONLY" => ReadOnlyError,
|
|
117
125
|
"WRONGTYPE" => WrongTypeError,
|
|
126
|
+
"OOM" => OutOfMemoryError,
|
|
118
127
|
}.freeze
|
|
119
128
|
|
|
120
129
|
class << self
|
|
@@ -652,11 +661,15 @@ class RedisClient
|
|
|
652
661
|
# The connection prelude is deliberately not sent to Middlewares
|
|
653
662
|
if config.sentinel?
|
|
654
663
|
prelude << ["ROLE"]
|
|
655
|
-
role, =
|
|
664
|
+
role, = Middlewares.call_pipelined(prelude, config) do
|
|
665
|
+
connection.call_pipelined(prelude, nil).last
|
|
666
|
+
end
|
|
656
667
|
config.check_role!(role)
|
|
657
668
|
else
|
|
658
669
|
unless prelude.empty?
|
|
659
|
-
|
|
670
|
+
Middlewares.call_pipelined(prelude, config) do
|
|
671
|
+
connection.call_pipelined(prelude, nil)
|
|
672
|
+
end
|
|
660
673
|
end
|
|
661
674
|
end
|
|
662
675
|
|
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.7.
|
|
4
|
+
version: 0.7.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jean Boussier
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|