redis-client 0.7.0 → 0.7.3

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: 43d0bd9c0a97bdf398a2eee688663b6aa18facfa54c03b77465872454c710dd6
4
- data.tar.gz: 628f5bd32c2cf5f4dabc326152f47d9ee474a9db748a0778fd111b8b529f3e84
3
+ metadata.gz: 38d06784583843dbaa9375de07c9c13313d79859b6c58aa8089174a01e2dd9cf
4
+ data.tar.gz: a83642acf97c40818c588cc151ad4c4a8c5191a4acf17275e5130c887a2617b0
5
5
  SHA512:
6
- metadata.gz: 8dd0782af2688e60628333605c57dcd54b97c38faf01f364e1599b85f34792139559e3a3f658e7b942d98438fa621725abbcad6101beec0d2a87076b34cbbd6c
7
- data.tar.gz: d7be85daadf3495f856de253fbd5744f143f92b087489a91436460ae5ef86be3af02aa7cff00582a79bf17bfe7c28b328e08e116c47285d29ff35a9454c37762
6
+ metadata.gz: 56b40ba378de26e41133216660c19ea81f506828547fad07e6c89e5fff16e9206ce446716153e3641ad00c3fcbe8422e0b68f9e1796824823535cfcaddf77742
7
+ data.tar.gz: c76f8800caf273870ad449d86108ec8d6aa17a777fd59e09fb61d066033d1b59b5c33742a71a870073426c8e5046bf405ee6bc073d8811f6aefbb186111688bc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Unreleased
2
2
 
3
+ # 0.7.3
4
+
5
+ - Fix a bug in `url` parsing conflicting with the `path` option.
6
+
7
+ # 0.7.2
8
+
9
+ - Raise a distinct `RedisClient::OutOfMemoryError`, for Redis `OOM` errors.
10
+ - Fix the instrumentation API to be called even for authentication commands.
11
+ - Fix `url:` configuration to accept a trailing slash.
12
+
13
+ # 0.7.1
14
+
15
+ - Fix `#pubsub` being called when reconnection is disabled (redis-rb compatibility fix).
16
+
3
17
  # 0.7.0
4
18
 
5
19
  - Sentinel config now accept a list of URLs: `RedisClient.sentinel(sentinels: %w(redis://example.com:7000 redis://example.com:7001 ..))`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- redis-client (0.7.0)
4
+ redis-client (0.7.3)
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
+ 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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RedisClient
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.3"
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
@@ -589,7 +591,11 @@ class RedisClient
589
591
 
590
592
  def ensure_connected(retryable: true)
591
593
  if @disable_reconnection
592
- yield @raw_connection
594
+ if block_given?
595
+ yield @raw_connection
596
+ else
597
+ @raw_connection
598
+ end
593
599
  elsif retryable
594
600
  tries = 0
595
601
  connection = nil
@@ -648,11 +654,15 @@ class RedisClient
648
654
  # The connection prelude is deliberately not sent to Middlewares
649
655
  if config.sentinel?
650
656
  prelude << ["ROLE"]
651
- role, = connection.call_pipelined(prelude, nil).last
657
+ role, = Middlewares.call_pipelined(prelude, config) do
658
+ connection.call_pipelined(prelude, nil).last
659
+ end
652
660
  config.check_role!(role)
653
661
  else
654
662
  unless prelude.empty?
655
- connection.call_pipelined(prelude, nil)
663
+ Middlewares.call_pipelined(prelude, config) do
664
+ connection.call_pipelined(prelude, nil)
665
+ end
656
666
  end
657
667
  end
658
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.0
4
+ version: 0.7.3
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-18 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