redis-cluster-client 0.11.4 → 0.11.5
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 +4 -4
- data/lib/redis_client/cluster/node.rb +1 -1
- data/lib/redis_client/cluster/pub_sub.rb +5 -2
- data/lib/redis_client/cluster.rb +3 -3
- 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: 175bb2bf9b82d2b1d0b95e8d7e3e74e3952165f2edea957303f8b16716a17273
|
4
|
+
data.tar.gz: 1e094b0d0ae859cb4d77cc872203c21f2f408b739a748d518fd60ca7c33e7451
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b8a13a4df4b5d96da3bcb618bada62d5882fb688b7fd7a9d618c6733a44913af24222c48d40f4db0a316d58b00aa608de99467114dac22711eb7b421f7e2e8a
|
7
|
+
data.tar.gz: 2c3ebd371f3a23388e6600192a6403c5f97a90f7a7c06bab747310fa729d8be8f9d7d793763a8e7829f2e4699893d76964a96bd0ea40e727d0bdb499e1ef9f67
|
@@ -309,7 +309,7 @@ class RedisClient
|
|
309
309
|
work_group.push(i, raw_client) do |client|
|
310
310
|
regular_timeout = client.read_timeout
|
311
311
|
client.read_timeout = @config.slow_command_timeout > 0.0 ? @config.slow_command_timeout : regular_timeout
|
312
|
-
reply = client.
|
312
|
+
reply = client.call_once('CLUSTER', 'NODES')
|
313
313
|
client.read_timeout = regular_timeout
|
314
314
|
parse_cluster_node_reply(reply)
|
315
315
|
rescue StandardError => e
|
@@ -35,11 +35,15 @@ class RedisClient
|
|
35
35
|
# Ruby VM allocates 1 MB memory as a stack for a thread.
|
36
36
|
# It is a fixed size but we can modify the size with some environment variables.
|
37
37
|
# So it consumes memory 1 MB multiplied a number of workers.
|
38
|
-
Thread.new(client, queue) do |pubsub, q|
|
38
|
+
Thread.new(client, queue, nil) do |pubsub, q, prev_err|
|
39
39
|
loop do
|
40
40
|
q << pubsub.next_event
|
41
|
+
prev_err = nil
|
41
42
|
rescue StandardError => e
|
43
|
+
next sleep 0.005 if e.instance_of?(prev_err.class) && e.message == prev_err&.message
|
44
|
+
|
42
45
|
q << e
|
46
|
+
prev_err = e
|
43
47
|
end
|
44
48
|
end
|
45
49
|
end
|
@@ -160,7 +164,6 @@ class RedisClient
|
|
160
164
|
@router.renew_cluster_state
|
161
165
|
@state_dict.each_value(&:close)
|
162
166
|
@state_dict.clear
|
163
|
-
@queue.clear
|
164
167
|
@commands.each { |command| _call(command) }
|
165
168
|
break
|
166
169
|
rescue ::RedisClient::ConnectionError, ::RedisClient::Cluster::NodeMightBeDown
|
data/lib/redis_client/cluster.rb
CHANGED
@@ -15,10 +15,10 @@ class RedisClient
|
|
15
15
|
|
16
16
|
attr_reader :config
|
17
17
|
|
18
|
-
def initialize(config, pool: nil, concurrency: nil, **kwargs)
|
19
|
-
@config = config
|
18
|
+
def initialize(config = nil, pool: nil, concurrency: nil, **kwargs)
|
19
|
+
@config = config.nil? ? ClusterConfig.new(**kwargs) : config
|
20
20
|
@concurrent_worker = ::RedisClient::Cluster::ConcurrentWorker.create(**(concurrency || {}))
|
21
|
-
@command_builder = config.command_builder
|
21
|
+
@command_builder = @config.command_builder
|
22
22
|
|
23
23
|
@pool = pool
|
24
24
|
@kwargs = kwargs
|
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.11.
|
4
|
+
version: 0.11.5
|
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-
|
11
|
+
date: 2024-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-client
|