Skip to content

Commit

Permalink
Chore: load balance hash need to have fallback strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Jul 4, 2022
1 parent 77a1e3a commit 557297a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions adapter/outboundgroup/loadbalance.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ func strategyConsistentHashing() strategyFn {
}
}

// when availability is poor, traverse the entire list to get the available nodes
for _, proxy := range proxies {
if proxy.Alive() {
return proxy
}
}

return proxies[0]
}
}
Expand Down

0 comments on commit 557297a

Please sign in to comment.