File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -2590,18 +2590,17 @@ def pfmerge(dest_key, *source_key)
2590
2590
def sentinel ( subcommand , *args )
2591
2591
subcommand = subcommand . to_s . downcase
2592
2592
synchronize do |client |
2593
- if subcommand == 'master'
2594
- client . call ( [ :sentinel , subcommand ] + args , &_hashify )
2595
- elsif subcommand == 'get-master-addr-by-name'
2596
- client . call ( [ :sentinel , subcommand ] + args )
2597
- else
2598
- client . call ( [ :sentinel , subcommand ] + args ) do |reply |
2593
+ client . call ( [ :sentinel , subcommand ] + args ) do |reply |
2594
+ case subcommand
2595
+ when "get-master-addr-by-name"
2596
+ reply
2597
+ else
2599
2598
if reply . kind_of? ( Array )
2600
- new_reply = Array . new
2601
- reply . each do |r |
2602
- new_reply << _hashify . call ( r )
2599
+ if reply [ 0 ] . kind_of? ( Array )
2600
+ reply . map ( &_hashify )
2601
+ else
2602
+ _hashify . call ( reply )
2603
2603
end
2604
- new_reply
2605
2604
else
2606
2605
reply
2607
2606
end
You can’t perform that action at this time.
0 commit comments