Rename LbStrategyFastest to LbStrategyFirst
This commit is contained in:
parent
3f2656dbe3
commit
2e89c8da01
|
@ -309,7 +309,8 @@ func ConfigLoad(proxy *Proxy, svcFlag *string) error {
|
|||
case "ph":
|
||||
lbStrategy = LBStrategyPH
|
||||
case "fastest":
|
||||
lbStrategy = LBStrategyFastest
|
||||
case "first":
|
||||
lbStrategy = LBStrategyFirst
|
||||
case "random":
|
||||
lbStrategy = LBStrategyRandom
|
||||
default:
|
||||
|
|
|
@ -118,7 +118,7 @@ keepalive = 30
|
|||
refused_code_in_responses = false
|
||||
|
||||
|
||||
## Load-balancing strategy: 'p2' (default), 'ph', 'fastest' or 'random'
|
||||
## Load-balancing strategy: 'p2' (default), 'ph', 'first' or 'random'
|
||||
|
||||
# lb_strategy = 'p2'
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ const (
|
|||
LBStrategyNone = LBStrategy(iota)
|
||||
LBStrategyP2
|
||||
LBStrategyPH
|
||||
LBStrategyFastest
|
||||
LBStrategyFirst
|
||||
LBStrategyRandom
|
||||
)
|
||||
|
||||
|
@ -192,7 +192,7 @@ func (serversInfo *ServersInfo) getOne() *ServerInfo {
|
|||
}
|
||||
}
|
||||
switch serversInfo.lbStrategy {
|
||||
case LBStrategyFastest:
|
||||
case LBStrategyFirst:
|
||||
candidate = 0
|
||||
case LBStrategyPH:
|
||||
candidate = rand.Intn(Min(Min(serversCount, 2), serversCount/2))
|
||||
|
|
Loading…
Reference in New Issue