File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,21 @@ class RedisClient
7
7
class Cluster
8
8
class Command
9
9
class << self
10
- def load ( nodes )
11
- errors = nodes &.map do |node |
10
+ def load ( nodes ) # rubocop:disable Metrics/MethodLength
11
+ errors = [ ]
12
+ cmd = nil
13
+ nodes &.each do |node |
14
+ break unless cmd . nil?
15
+
12
16
reply = node . call ( 'COMMAND' )
13
17
details = parse_command_details ( reply )
14
- return ::RedisClient ::Cluster ::Command . new ( details )
15
- rescue ::RedisClient ::ConnectionError , :: RedisClient :: CommandError => e
16
- e
18
+ cmd = ::RedisClient ::Cluster ::Command . new ( details )
19
+ rescue ::RedisClient ::Error => e
20
+ errors << e
17
21
end
18
22
23
+ return cmd unless cmd . nil?
24
+
19
25
raise ::RedisClient ::Cluster ::InitialSetupError , errors
20
26
end
21
27
You can’t perform that action at this time.
0 commit comments