redis-client 0.26.3 → 0.26.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1158a824b42ce5297ff9eb38755a9af61ccc3635f6f201e17708e91ffc8b230
4
- data.tar.gz: 8c8ffd7afa1672760e628ae6725f02b614588a963288dd55cb8fc2b5db43ed82
3
+ metadata.gz: 154a0c259fc2b3ccd21836d769541db74daef95be9d2e235a36c15b8b6d68d3b
4
+ data.tar.gz: 5f27693c2903da092547ad8f4362a1573e8527d9ef38266074c389574523971b
5
5
  SHA512:
6
- metadata.gz: 2ba91ae532685d186151cc2a2b3b9d2cc485968a4b4aafb765fae2bce0046d962776dd5dd9ba783c9baae7425d785af9600d28b22befaf982ea90689ec373242
7
- data.tar.gz: 373343251df2027cb19ab4fab1cdc63de4b5d2f2ca5bcc2542e9486818bbc93b6b88da63d34a1db63044f4adba690b4d2f534390acb8c2739a633c9b6bfcda42
6
+ metadata.gz: ca23aa033f2142cd608cf6197a35b0e32c89f1240344853be148b9eefbec330bbf1a8507277c822482455a8e7198abec888ce73c1f842382d5ebc826c417c5d2
7
+ data.tar.gz: e5f2086185d04e12462dc176a3c90084d7a7b04c520f906dcdb6024a1a42a6d7b418d5c94951628062a746ed0a0426add0970d877587f6b3d25843baf2c0a780
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Unreleased
2
2
 
3
+ # 0.26.4
4
+
5
+ - Further improve `rediss://` URLs used with Redis sentinel. Now avoid override explictly set `ssl:` paramter.
6
+ - Fix compatibility with `redis-rb` in sentinel mode.
7
+
3
8
  # 0.26.3
4
9
 
5
10
  - Fix `rediss://` (ssl) URLs used with Redis sentinel.
@@ -22,6 +22,9 @@ class RedisClient
22
22
  raise ArgumentError, "Expected role to be either :master or :replica, got: #{role.inspect}"
23
23
  end
24
24
 
25
+ # Track whether SSL was explicitly provided by user
26
+ ssl_explicitly_set = client_config.key?(:ssl)
27
+
25
28
  if url
26
29
  url_config = URLConfig.new(url)
27
30
  client_config = {
@@ -68,7 +71,9 @@ class RedisClient
68
71
  client_config[:reconnect_attempts] ||= DEFAULT_RECONNECT_ATTEMPTS
69
72
  @client_config = client_config || {}
70
73
  @sentinel_client_config = @client_config.dup
71
- @sentinel_client_config.delete(:ssl)
74
+ # Only remove SSL from sentinel config if it was derived from URL,
75
+ # not if explicitly set by user.
76
+ @sentinel_client_config.delete(:ssl) unless ssl_explicitly_set
72
77
  super(**client_config)
73
78
  @sentinel_configs = sentinels_to_configs(sentinels)
74
79
  end
@@ -155,7 +160,7 @@ class RedisClient
155
160
 
156
161
  def resolve_master
157
162
  each_sentinel do |sentinel_client|
158
- host, port = sentinel_client.call("SENTINEL", "get-master-addr-by-name", @name)
163
+ host, port = sentinel_client.call_v(["SENTINEL", "get-master-addr-by-name", @name])
159
164
  next unless host && port
160
165
 
161
166
  refresh_sentinels(sentinel_client)
@@ -174,7 +179,7 @@ class RedisClient
174
179
 
175
180
  def resolve_replica
176
181
  each_sentinel do |sentinel_client|
177
- replicas = sentinel_client.call("SENTINEL", "replicas", @name, &@to_list_of_hash)
182
+ replicas = sentinel_client.call_v(["SENTINEL", "replicas", @name], &@to_list_of_hash)
178
183
  replicas.reject! do |r|
179
184
  flags = r["flags"].to_s.split(",")
180
185
  flags.include?("s_down") || flags.include?("o_down")
@@ -217,7 +222,7 @@ class RedisClient
217
222
  end
218
223
 
219
224
  def refresh_sentinels(sentinel_client)
220
- sentinel_response = sentinel_client.call("SENTINEL", "sentinels", @name, &@to_list_of_hash)
225
+ sentinel_response = sentinel_client.call_v(["SENTINEL", "sentinels", @name], &@to_list_of_hash)
221
226
  sentinels = sentinel_response.map do |sentinel|
222
227
  { host: sentinel.fetch("ip"), port: Integer(sentinel.fetch("port")) }
223
228
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RedisClient
4
- VERSION = "0.26.3"
4
+ VERSION = "0.26.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.3
4
+ version: 0.26.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier