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 +4 -4
- data/lib/redis_client/cluster/node.rb +5 -1
- data/lib/redis_client/cluster/router.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be213593746d1aceb880d03bf002812ca650fa0f76aa6e906f52f2650a0fb758
|
4
|
+
data.tar.gz: e5e9d541f024c595a2dac84db7f5a60a9df3b318ebcc20dfc60cbfa91b30cc8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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.
|
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-
|
11
|
+
date: 2023-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-client
|