mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-02 18:06:47 +00:00
Chore: load balance hash need to have fallback strategy
This commit is contained in:
1 parent
38e6b81d07
commit
7d84a47683
1 file changed
+7
@@ -145,6 +145,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]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user