@@ -29,7 +29,7 @@ def initialize(config, concurrent_worker, pool: nil, **kwargs)
29
29
@pool = pool
30
30
@client_kwargs = kwargs
31
31
@node = ::RedisClient ::Cluster ::Node . new ( concurrent_worker , config : config , pool : pool , **kwargs )
32
- update_cluster_info !
32
+ @node . reload !
33
33
@command = ::RedisClient ::Cluster ::Command . load ( @node . replica_clients . shuffle , slow_command_timeout : config . slow_command_timeout )
34
34
@command_builder = @config . command_builder
35
35
end
@@ -68,12 +68,12 @@ def send_command(method, command, *args, &block) # rubocop:disable Metrics/AbcSi
68
68
rescue ::RedisClient ::CircuitBreaker ::OpenCircuitError
69
69
raise
70
70
rescue ::RedisClient ::Cluster ::Node ::ReloadNeeded
71
- update_cluster_info !
71
+ @node . reload !
72
72
raise ::RedisClient ::Cluster ::NodeMightBeDown
73
73
rescue ::RedisClient ::Cluster ::ErrorCollection => e
74
74
raise if e . errors . any? ( ::RedisClient ::CircuitBreaker ::OpenCircuitError )
75
75
76
- update_cluster_info ! if e . errors . values . any? do |err |
76
+ @node . reload ! if e . errors . values . any? do |err |
77
77
next false if ::RedisClient ::Cluster ::ErrorIdentification . identifiable? ( err ) && @node . none? { |c | ::RedisClient ::Cluster ::ErrorIdentification . client_owns_error? ( err , c ) }
78
78
79
79
err . message . start_with? ( 'CLUSTERDOWN Hash slot not served' )
@@ -119,15 +119,15 @@ def handle_redirection(node, retry_count:) # rubocop:disable Metrics/AbcSize, Me
119
119
retry
120
120
end
121
121
elsif e . message . start_with? ( 'CLUSTERDOWN Hash slot not served' )
122
- update_cluster_info !
122
+ @node . reload !
123
123
retry_count -= 1
124
124
retry if retry_count >= 0
125
125
end
126
126
raise
127
127
rescue ::RedisClient ::ConnectionError => e
128
128
raise unless ::RedisClient ::Cluster ::ErrorIdentification . client_owns_error? ( e , node )
129
129
130
- update_cluster_info !
130
+ @node . reload !
131
131
132
132
raise if retry_count <= 0
133
133
@@ -205,7 +205,7 @@ def find_node(node_key, retry_count: 3)
205
205
rescue ::RedisClient ::Cluster ::Node ::ReloadNeeded
206
206
raise ::RedisClient ::Cluster ::NodeMightBeDown if retry_count <= 0
207
207
208
- update_cluster_info !
208
+ @node . reload !
209
209
retry_count -= 1
210
210
retry
211
211
end
@@ -245,7 +245,7 @@ def send_wait_command(method, command, args, retry_count: 3, &block) # rubocop:d
245
245
err . message . include? ( 'WAIT cannot be used with replica instances' )
246
246
end
247
247
248
- update_cluster_info !
248
+ @node . reload !
249
249
retry_count -= 1
250
250
retry
251
251
end
@@ -370,10 +370,6 @@ def send_multiple_keys_command(cmd, method, command, args, &block) # rubocop:dis
370
370
end
371
371
block_given? ? yield ( result ) : result
372
372
end
373
-
374
- def update_cluster_info!
375
- @node . reload!
376
- end
377
373
end
378
374
end
379
375
end
0 commit comments