Chore: load balance hash need to have fallback strategy
This commit is contained in:
parent
100b6b7f9b
commit
5e03be2fb9
1 changed files with 7 additions and 0 deletions
|
@ -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]
|
return proxies[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue