redis-client 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4170ea87f36925fbfdd698282bfaacc9d922c5cdb2a3474944cbf1ad10f86a4
4
- data.tar.gz: 46add9543d181621ebb5c54594318d4111c00c8153083b3c84c9363693eceb95
3
+ metadata.gz: 81e19420827bc96f40097f45a68660c9158a72de1bf181a4a1713d12630964f0
4
+ data.tar.gz: ea48a355e633b2b54415e06b1fdff363879296ffb67085b97ee67ee52ec0e4dd
5
5
  SHA512:
6
- metadata.gz: ae48b57736db4a41686f2e9462b85c193ebe75bf323d2684c89ae5905aa4000cd69c806fd1ee9d63a117ad6e35a6d4befd28779938726e2ab4932273e32dbe46
7
- data.tar.gz: d17c48e6252575b6842bff27dee3a608f066a9646684d675a2bd9bfd8285c308797c8359137b213f6d736377324e6d10b5f4e3fd306e605d891b14cef93f906f
6
+ metadata.gz: a01f575d01adb1260d01be754ccbd3e39d03415ed4ce4f28998bfe081b298eff041a39acefbc594a058647968e6d9e5ae245f58dc05889243428abd731fc01e8
7
+ data.tar.gz: '099a087f0f32deb096302080128b817f0472be41bdce36e4df05d0d3404b2329661aa353491a388a671765349bf170c76c1284d84ffa24981ef3e46647225770'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Unreleased
2
2
 
3
+ # 0.7.2
4
+
5
+ - Raise a distinct `RedisClient::OutOfMemoryError`, for Redis `OOM` errors.
6
+ - Fix the instrumentation API to be called even for authentication commands.
7
+ - Fix `url:` configuration to accept a trailing slash.
8
+
3
9
  # 0.7.1
4
10
 
5
11
  - 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.1)
4
+ redis-client (0.7.2)
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.21.0)
18
- parser (3.1.1.0)
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.1.9)
22
+ rake-compiler (1.2.0)
23
23
  rake
24
24
  redis (4.6.0)
25
- regexp_parser (2.2.1)
25
+ regexp_parser (2.5.0)
26
26
  rexml (3.2.5)
27
- rubocop (1.25.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.15.1, < 2.0)
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.16.0)
36
+ rubocop-ast (1.17.0)
37
37
  parser (>= 3.1.1.0)
38
- rubocop-minitest (0.14.0)
38
+ rubocop-minitest (0.19.1)
39
39
  rubocop (>= 0.90, < 2.0)
40
40
  ruby-progressbar (1.11.0)
41
41
  stackprof (0.2.19)
42
- toxiproxy (2.0.0)
43
- unicode-display_width (2.1.0)
42
+ toxiproxy (2.0.2)
43
+ unicode-display_width (2.2.0)
44
44
 
45
45
  PLATFORMS
46
46
  ruby
@@ -149,7 +149,8 @@ class RedisClient
149
149
  URI.decode_www_form_component(uri.password)
150
150
  end
151
151
 
152
- kwargs[:db] ||= Integer(uri.path.delete_prefix("/")) if uri.path && !uri.path.empty?
152
+ path = uri.path&.delete_prefix("/")
153
+ kwargs[:db] ||= Integer(path) if path && !path.empty?
153
154
  end
154
155
 
155
156
  super(**kwargs)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RedisClient
4
- VERSION = "0.7.1"
4
+ VERSION = "0.7.2"
5
5
  end
data/lib/redis_client.rb CHANGED
@@ -109,12 +109,14 @@ class RedisClient
109
109
  PermissionError = Class.new(CommandError)
110
110
  ReadOnlyError = Class.new(CommandError)
111
111
  WrongTypeError = Class.new(CommandError)
112
+ OutOfMemoryError = Class.new(CommandError)
112
113
 
113
114
  CommandError::ERRORS = {
114
115
  "WRONGPASS" => AuthenticationError,
115
116
  "NOPERM" => PermissionError,
116
117
  "READONLY" => ReadOnlyError,
117
118
  "WRONGTYPE" => WrongTypeError,
119
+ "OOM" => OutOfMemoryError,
118
120
  }.freeze
119
121
 
120
122
  class << self
@@ -652,11 +654,15 @@ class RedisClient
652
654
  # The connection prelude is deliberately not sent to Middlewares
653
655
  if config.sentinel?
654
656
  prelude << ["ROLE"]
655
- role, = connection.call_pipelined(prelude, nil).last
657
+ role, = Middlewares.call_pipelined(prelude, config) do
658
+ connection.call_pipelined(prelude, nil).last
659
+ end
656
660
  config.check_role!(role)
657
661
  else
658
662
  unless prelude.empty?
659
- connection.call_pipelined(prelude, nil)
663
+ Middlewares.call_pipelined(prelude, config) do
664
+ connection.call_pipelined(prelude, nil)
665
+ end
660
666
  end
661
667
  end
662
668
 
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.1
4
+ version: 0.7.2
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-08-19 00:00:00.000000000 Z
11
+ date: 2022-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool