redis-client 0.7.2 → 0.8.0
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 +12 -0
- data/Gemfile.lock +2 -2
- data/README.md +4 -0
- data/lib/redis_client/config.rb +2 -2
- data/lib/redis_client/middlewares.rb +4 -0
- data/lib/redis_client/version.rb +1 -1
- data/lib/redis_client.rb +16 -7
- 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: e7e7b7923ecb86353521db31036b3c5678683fcb6ed8ec5799c1ca6c6b5fcd44
|
4
|
+
data.tar.gz: 9e782f9884b2f12eb0c58ca701da62e8945a14a1eca27c3052adbb0a1e4fe428
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c77d09a8330bbcc4e8b2329a1ff9e660bb2c5ddf35cccafcf89f0b37ef9d89f579fa32b9ec7a7f64eecff12941ac835e4424dcf7ab9fdef12fc01ae73250959f
|
7
|
+
data.tar.gz: 4c16639282ca539e04d07d363c28e663a5e409f6c6d9deef856158fe8d46a1e20669b44c025e978dc04965106148e1fd7fcd82cc1d50abc8c27fb4694b825e2e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# 0.8.0
|
4
|
+
|
5
|
+
- Add a `connect` interface to the instrumentation API.
|
6
|
+
|
7
|
+
# 0.7.4
|
8
|
+
|
9
|
+
- Properly parse script errors on pre 7.0 redis server.
|
10
|
+
|
11
|
+
# 0.7.3
|
12
|
+
|
13
|
+
- Fix a bug in `url` parsing conflicting with the `path` option.
|
14
|
+
|
3
15
|
# 0.7.2
|
4
16
|
|
5
17
|
- Raise a distinct `RedisClient::OutOfMemoryError`, for Redis `OOM` errors.
|
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.8.0)
|
5
5
|
connection_pool
|
6
6
|
|
7
7
|
GEM
|
@@ -38,7 +38,7 @@ GEM
|
|
38
38
|
rubocop-minitest (0.19.1)
|
39
39
|
rubocop (>= 0.90, < 2.0)
|
40
40
|
ruby-progressbar (1.11.0)
|
41
|
-
stackprof (0.2.
|
41
|
+
stackprof (0.2.21)
|
42
42
|
toxiproxy (2.0.2)
|
43
43
|
unicode-display_width (2.2.0)
|
44
44
|
|
data/README.md
CHANGED
@@ -349,6 +349,10 @@ end
|
|
349
349
|
|
350
350
|
```ruby
|
351
351
|
module MyRedisInstrumentation
|
352
|
+
def connect(redis_config)
|
353
|
+
MyMonitoringService.instrument("redis.connect") { super }
|
354
|
+
end
|
355
|
+
|
352
356
|
def call(command, redis_config)
|
353
357
|
MyMonitoringService.instrument("redis.query") { super }
|
354
358
|
end
|
data/lib/redis_client/config.rb
CHANGED
@@ -149,8 +149,8 @@ class RedisClient
|
|
149
149
|
URI.decode_www_form_component(uri.password)
|
150
150
|
end
|
151
151
|
|
152
|
-
|
153
|
-
kwargs[:db] ||= Integer(
|
152
|
+
db_path = uri.path&.delete_prefix("/")
|
153
|
+
kwargs[:db] ||= Integer(db_path) if db_path && !db_path.empty?
|
154
154
|
end
|
155
155
|
|
156
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
|
@@ -638,12 +645,14 @@ class RedisClient
|
|
638
645
|
end
|
639
646
|
|
640
647
|
def connect
|
641
|
-
connection =
|
642
|
-
config
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
648
|
+
connection = Middlewares.connect(config) do
|
649
|
+
config.driver.new(
|
650
|
+
config,
|
651
|
+
connect_timeout: connect_timeout,
|
652
|
+
read_timeout: read_timeout,
|
653
|
+
write_timeout: write_timeout,
|
654
|
+
)
|
655
|
+
end
|
647
656
|
|
648
657
|
prelude = config.connection_prelude.dup
|
649
658
|
|
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.8.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: 2022-09-
|
11
|
+
date: 2022-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|