redis 5.0.0 → 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 +12 -0
- data/lib/redis/client.rb +28 -7
- data/lib/redis/commands/server.rb +1 -1
- data/lib/redis/errors.rb +3 -0
- data/lib/redis/version.rb +1 -1
- data/lib/redis.rb +10 -0
- 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
@@ -1,5 +1,17 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# 5.0.3
|
4
|
+
|
5
|
+
- Add `OutOfMemoryError` as a subclass of `CommandError`
|
6
|
+
|
7
|
+
# 5.0.2
|
8
|
+
|
9
|
+
- Fix `Redis#close` to properly reset the fork protection check.
|
10
|
+
|
11
|
+
# 5.0.1
|
12
|
+
|
13
|
+
- Added a fake `Redis::Connections.drivers` method to be compatible with older sidekiq versions.
|
14
|
+
|
3
15
|
# 5.0.0
|
4
16
|
|
5
17
|
- Eagerly and strictly cast Integer and Float parameters.
|
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)
|
@@ -30,7 +31,7 @@ class Redis
|
|
30
31
|
def initialize(*)
|
31
32
|
super
|
32
33
|
@inherit_socket = false
|
33
|
-
@pid =
|
34
|
+
@pid = nil
|
34
35
|
end
|
35
36
|
ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true)
|
36
37
|
|
@@ -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)
|
@@ -114,10 +115,30 @@ class Redis
|
|
114
115
|
@inherit_socket = true
|
115
116
|
end
|
116
117
|
|
118
|
+
def close
|
119
|
+
super
|
120
|
+
@pid = nil
|
121
|
+
end
|
122
|
+
|
117
123
|
private
|
118
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
|
+
|
119
140
|
def ensure_connected(retryable: true)
|
120
|
-
unless @inherit_socket || Process.pid ==
|
141
|
+
unless @inherit_socket || (@pid ||= Process.pid) == Process.pid
|
121
142
|
raise InheritedError,
|
122
143
|
"Tried to use a connection from a child process without reconnecting. " \
|
123
144
|
"You need to reconnect to Redis after forking " \
|
@@ -36,7 +36,7 @@ class Redis
|
|
36
36
|
#
|
37
37
|
# @param [String, Symbol] subcommand e.g. `kill`, `list`, `getname`, `setname`
|
38
38
|
# @return [String, Hash] depends on subcommand
|
39
|
-
def client(subcommand
|
39
|
+
def client(subcommand, *args)
|
40
40
|
send_command([:client, subcommand] + args) do |reply|
|
41
41
|
if subcommand.to_s == "list"
|
42
42
|
reply.lines.map do |line|
|
data/lib/redis/errors.rb
CHANGED
data/lib/redis/version.rb
CHANGED
data/lib/redis.rb
CHANGED
@@ -22,6 +22,16 @@ class Redis
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
# soft-deprecated
|
26
|
+
# We added this back for older sidekiq releases
|
27
|
+
module Connection
|
28
|
+
class << self
|
29
|
+
def drivers
|
30
|
+
[RedisClient.default_driver]
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
25
35
|
include Commands
|
26
36
|
|
27
37
|
SERVER_URL_OPTIONS = %i(url host port path).freeze
|
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:
|