redis-cluster-client 0.10.0 → 0.11.0

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: f88b4bd96fd24566377d49a45a06eaa5fc8029749462995e746074979ba25e70
4
- data.tar.gz: a5ecd1339399ba2dda3c004c1cf1bbb2e2510c2f963f0f69afcf71544a8b530c
3
+ metadata.gz: d885c147de46fd113d493e60bd340cac591ecc94b7eafcfddbd6044abe10f79a
4
+ data.tar.gz: f13c1012ef977e8f9c3e38d928c5c3eb95ba2242761fa992033323c115b318f9
5
5
  SHA512:
6
- metadata.gz: 81b1776f48d1b84866c21e0f00ee644df2f077e06536a6af2b305e50104296b7dabeb9732cce51e0aaca6ce5111a406b21b14db8c114d56e2b3f8f4b7701f2f7
7
- data.tar.gz: b2ecb424e00825a115d15808814ee58a7afc06205cf5ca1e4732ca7189a6b9d42d13597974fa8674ca6f1102aa13641d8b7b25883bcea9ede743e2df3dba4814
6
+ metadata.gz: 68c939431088425c7735c68b4af0949bc5918837d9f19878c62d71aa1fec6e31efee5de2868325447a9e4672c108299a86cc6d047447ef10e7987daa04ecb1e9
7
+ data.tar.gz: f8ae784f6977151fd825c34878e7f6162175cd828d0b81a92da07e5af96a00a56467ffbed3822f24c198f2373900dc20ea69f8446e3468fc7ba54945baa44f65
@@ -13,9 +13,6 @@ class RedisClient
13
13
  class Node
14
14
  include Enumerable
15
15
 
16
- # It affects to strike a balance between load and stability in initialization or changed states.
17
- MAX_STARTUP_SAMPLE = Integer(ENV.fetch('REDIS_CLIENT_MAX_STARTUP_SAMPLE', 3))
18
-
19
16
  # less memory consumption, but slow
20
17
  USE_CHAR_ARRAY_SLOT = Integer(ENV.fetch('REDIS_CLIENT_USE_CHAR_ARRAY_SLOT', 1)) == 1
21
18
 
@@ -197,7 +194,7 @@ class RedisClient
197
194
 
198
195
  def reload!
199
196
  with_reload_lock do
200
- with_startup_clients(MAX_STARTUP_SAMPLE) do |startup_clients|
197
+ with_startup_clients(@config.max_startup_sample) do |startup_clients|
201
198
  @node_info = refetch_node_info_list(startup_clients)
202
199
  @node_configs = @node_info.to_h do |node_info|
203
200
  [node_info.node_key, @config.client_config_for_node(node_info.node_key)]
@@ -20,13 +20,15 @@ class RedisClient
20
20
  MAX_WORKERS = Integer(ENV.fetch('REDIS_CLIENT_MAX_THREADS', 5))
21
21
  # It's used with slow queries of fetching meta data like CLUSTER NODES, COMMAND and so on.
22
22
  SLOW_COMMAND_TIMEOUT = Float(ENV.fetch('REDIS_CLIENT_SLOW_COMMAND_TIMEOUT', -1))
23
+ # It affects to strike a balance between load and stability in initialization or changed states.
24
+ MAX_STARTUP_SAMPLE = Integer(ENV.fetch('REDIS_CLIENT_MAX_STARTUP_SAMPLE', 3))
23
25
 
24
26
  InvalidClientConfigError = Class.new(::RedisClient::Error)
25
27
 
26
28
  attr_reader :command_builder, :client_config, :replica_affinity, :slow_command_timeout,
27
- :connect_with_original_config, :startup_nodes
29
+ :connect_with_original_config, :startup_nodes, :max_startup_sample
28
30
 
29
- def initialize(
31
+ def initialize( # rubocop:disable Metrics/ParameterLists
30
32
  nodes: DEFAULT_NODES,
31
33
  replica: false,
32
34
  replica_affinity: :random,
@@ -36,6 +38,7 @@ class RedisClient
36
38
  client_implementation: ::RedisClient::Cluster, # for redis gem
37
39
  slow_command_timeout: SLOW_COMMAND_TIMEOUT,
38
40
  command_builder: ::RedisClient::CommandBuilder,
41
+ max_startup_sample: MAX_STARTUP_SAMPLE,
39
42
  **client_config
40
43
  )
41
44
 
@@ -51,6 +54,7 @@ class RedisClient
51
54
  @connect_with_original_config = connect_with_original_config
52
55
  @client_implementation = client_implementation
53
56
  @slow_command_timeout = slow_command_timeout
57
+ @max_startup_sample = max_startup_sample
54
58
  end
55
59
 
56
60
  def inspect
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.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-13 00:00:00.000000000 Z
11
+ date: 2024-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  requirements: []
80
- rubygems_version: 3.5.9
80
+ rubygems_version: 3.5.11
81
81
  signing_key:
82
82
  specification_version: 4
83
83
  summary: A Redis cluster client for Ruby