redis-cluster-client 0.4.12 → 0.4.14

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: d8eb62456ad98c03e10bf81773dfb27cfaf68b7ad8af608b13e2427e950e7379
4
- data.tar.gz: 736117d62e45313ca6f96e97e0e3fc03093a9542315302233a55c3cde2731303
3
+ metadata.gz: bd46d3091e80d00d8495ce291e29a400b5010a1778214f3314054d259af73db9
4
+ data.tar.gz: b04ca7a3cd458ac5fddbc24b640b26705e05032e5cf1c48a1bae25f94396bd57
5
5
  SHA512:
6
- metadata.gz: 81079a5a9985bd4fbe2b20f3ffaa5e59db4c95f9f9f184209b50ca897ab3fa3cdee8687f9be90cf46b0a371c668dff171c1f3488b3e848885d738133f0bf6e2a
7
- data.tar.gz: 0d1e9da7b0de3cec96cb88431d2cdd935c9764c268610e4146737ae6bd7d634869a82d9425243a3c2307d7277974b1df5f3ee8d9abd78bab6169453fc724e3d3
6
+ metadata.gz: 888cd4fad351e1f23e3db2a751c0622ab7be6113d1830a9439e2ac27dc70a3daff021877f56922fdba7b6068f7707c05f96ac64d7bf21981fca7ba7567e29fcb
7
+ data.tar.gz: 4e3525dbd3cfcb9eacd9347005455de34f14af08ab1294d6f1a49dacb9f7cc1d777fef60722cda9268aa6b9b3681dfdb1e593b408731d57fcc8ad4be5fdd6b5c
@@ -201,6 +201,10 @@ class RedisClient
201
201
  @topology.clients.each_value(&block)
202
202
  end
203
203
 
204
+ def shuffled_nodes
205
+ @topology.clients.values.shuffle
206
+ end
207
+
204
208
  def sample
205
209
  @topology.clients.values.sample
206
210
  end
@@ -74,6 +74,8 @@ class RedisClient
74
74
  message = pubsub.take_message(timeout)
75
75
  return message if message
76
76
  end
77
+
78
+ sleep 0.001
77
79
  end
78
80
  end
79
81
 
@@ -23,7 +23,7 @@ class RedisClient
23
23
  @pool = pool
24
24
  @client_kwargs = kwargs
25
25
  @node = fetch_cluster_info(@config, pool: @pool, **@client_kwargs)
26
- @command = ::RedisClient::Cluster::Command.load(@node)
26
+ @command = ::RedisClient::Cluster::Command.load(@node.shuffled_nodes)
27
27
  @mutex = Mutex.new
28
28
  @command_builder = @config.command_builder
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-cluster-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.12
4
+ version: 0.4.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-12 00:00:00.000000000 Z
11
+ date: 2023-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client