redis-cluster-client 0.4.13 → 0.4.15

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: 840b8fc3ccf9f870d2a5911a6b529f4ddc021e2c9ebb41f88f54c0fb324c6b89
4
- data.tar.gz: da935ffb827910097b824247c6f308afe6177ba701be3307494628100ae85d43
3
+ metadata.gz: be213593746d1aceb880d03bf002812ca650fa0f76aa6e906f52f2650a0fb758
4
+ data.tar.gz: e5e9d541f024c595a2dac84db7f5a60a9df3b318ebcc20dfc60cbfa91b30cc8a
5
5
  SHA512:
6
- metadata.gz: 8973e3c8f747aad5e2e41649a7c3fb9787cdf8f794b7f9c9bb16225a0f15504746d9be65cc7eb0760bd6259d8e97f931ca578f3a71cc9a9c2094a8c00cf0e1f3
7
- data.tar.gz: f13ce04e702ff896e7ab63c92f5cde997c878328bf87c539c7c764dd9c3e7b80efbf1af6edfc31946bed9d6fb69b549a60b4d7cab57d0acf4b721bf8859a9810
6
+ metadata.gz: 6d2bbd083b59645a96e3b97096f80cbe22c0788213b9f1b69a21d661fdf88d9f20abf1fdd785ef5e26ee083f5ce42d232da73863bc7015cdc17f836f01440c20
7
+ data.tar.gz: c792f23f43397ff380f277e1c7b7d9cc54090f9cd6eb302c7aff8bacaacd31da98ba9a810991a566b1081cf7d96b889e608e9ad77239157b7c92ed1461fe2ebe
@@ -15,7 +15,7 @@ class RedisClient
15
15
  SLOT_SIZE = 16_384
16
16
  MIN_SLOT = 0
17
17
  MAX_SLOT = SLOT_SIZE - 1
18
- MAX_STARTUP_SAMPLE = 37
18
+ MAX_STARTUP_SAMPLE = Integer(ENV.fetch('REDIS_CLIENT_MAX_STARTUP_SAMPLE', 3))
19
19
  MAX_THREADS = Integer(ENV.fetch('REDIS_CLIENT_MAX_THREADS', 5))
20
20
  IGNORE_GENERIC_CONFIG_KEYS = %i[url host port path].freeze
21
21
  DEAD_FLAGS = %w[fail? fail handshake noaddr noflags].freeze
@@ -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
@@ -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.13
4
+ version: 0.4.15
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-13 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