redis 5.0.2 → 5.0.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 -0
- data/lib/redis/client.rb +21 -5
- data/lib/redis/errors.rb +3 -0
- data/lib/redis/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cba7e365db1b9e04cf596a09210949a7ad7be48df25863d28654690e0f9c9ded
|
4
|
+
data.tar.gz: c846522122894b000cbae0fedbee70bd1b27880baa8138e6aea73f6a06820146
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7e818dba56ff62bb7b95c221acffd9637be088b0da1b76870cfc6c7b8980e3da32636a1e99ff4debcc85aaf8c8d70d105301beae4fb0ee0255bef502b72caf0
|
7
|
+
data.tar.gz: 28956e7dab6c737e923c3d19a03ce41d81b7e7406d04119a3a225748f1150d708d0b0baf231ce08e297626d58c9ab8cc97a5f31be93750a1e0d5362778a085fe
|
data/CHANGELOG.md
CHANGED
data/lib/redis/client.rb
CHANGED
@@ -15,7 +15,8 @@ class Redis
|
|
15
15
|
RedisClient::WrongTypeError => Redis::WrongTypeError,
|
16
16
|
RedisClient::ReadOnlyError => Redis::ReadOnlyError,
|
17
17
|
RedisClient::ProtocolError => Redis::ProtocolError,
|
18
|
-
|
18
|
+
RedisClient::OutOfMemoryError => Redis::OutOfMemoryError,
|
19
|
+
}
|
19
20
|
|
20
21
|
class << self
|
21
22
|
def config(**kwargs)
|
@@ -78,7 +79,7 @@ class Redis
|
|
78
79
|
def call_v(command, &block)
|
79
80
|
super(command, &block)
|
80
81
|
rescue ::RedisClient::Error => error
|
81
|
-
|
82
|
+
translate_error!(error)
|
82
83
|
end
|
83
84
|
|
84
85
|
def blocking_call_v(timeout, command, &block)
|
@@ -91,19 +92,19 @@ class Redis
|
|
91
92
|
|
92
93
|
super(timeout, command, &block)
|
93
94
|
rescue ::RedisClient::Error => error
|
94
|
-
|
95
|
+
translate_error!(error)
|
95
96
|
end
|
96
97
|
|
97
98
|
def pipelined
|
98
99
|
super
|
99
100
|
rescue ::RedisClient::Error => error
|
100
|
-
|
101
|
+
translate_error!(error)
|
101
102
|
end
|
102
103
|
|
103
104
|
def multi
|
104
105
|
super
|
105
106
|
rescue ::RedisClient::Error => error
|
106
|
-
|
107
|
+
translate_error!(error)
|
107
108
|
end
|
108
109
|
|
109
110
|
def disable_reconnection(&block)
|
@@ -121,6 +122,21 @@ class Redis
|
|
121
122
|
|
122
123
|
private
|
123
124
|
|
125
|
+
def translate_error!(error)
|
126
|
+
redis_error = translate_error_class(error.class)
|
127
|
+
raise redis_error, error.message, error.backtrace
|
128
|
+
end
|
129
|
+
|
130
|
+
def translate_error_class(error_class)
|
131
|
+
ERROR_MAPPING.fetch(error_class)
|
132
|
+
rescue IndexError
|
133
|
+
if (client_error = error_class.ancestors.find { |a| ERROR_MAPPING[a] })
|
134
|
+
ERROR_MAPPING[error_class] = ERROR_MAPPING[client_error]
|
135
|
+
else
|
136
|
+
raise
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
124
140
|
def ensure_connected(retryable: true)
|
125
141
|
unless @inherit_socket || (@pid ||= Process.pid) == Process.pid
|
126
142
|
raise InheritedError,
|
data/lib/redis/errors.rb
CHANGED
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: 5.0.
|
4
|
+
version: 5.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezra Zygmuntowicz
|
@@ -16,22 +16,22 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2022-
|
19
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: redis-client
|
23
23
|
requirement: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 0.7.4
|
28
28
|
type: :runtime
|
29
29
|
prerelease: false
|
30
30
|
version_requirements: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 0.7.4
|
35
35
|
description: |2
|
36
36
|
A Ruby client that tries to match Redis' API one-to-one, while still
|
37
37
|
providing an idiomatic interface.
|
@@ -75,9 +75,9 @@ licenses:
|
|
75
75
|
metadata:
|
76
76
|
bug_tracker_uri: https://github.com/redis/redis-rb/issues
|
77
77
|
changelog_uri: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md
|
78
|
-
documentation_uri: https://www.rubydoc.info/gems/redis/5.0.
|
78
|
+
documentation_uri: https://www.rubydoc.info/gems/redis/5.0.3
|
79
79
|
homepage_uri: https://github.com/redis/redis-rb
|
80
|
-
source_code_uri: https://github.com/redis/redis-rb/tree/v5.0.
|
80
|
+
source_code_uri: https://github.com/redis/redis-rb/tree/v5.0.3
|
81
81
|
post_install_message:
|
82
82
|
rdoc_options: []
|
83
83
|
require_paths:
|