mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-28 20:01:15 +08:00
reverseproxy: Fix least_conn
policy regression (#5862)
This commit is contained in:
parent
a8586b05aa
commit
e8b8d4a8cd
|
@ -269,7 +269,7 @@ func (LeastConnSelection) Select(pool UpstreamPool, _ *http.Request, _ http.Resp
|
|||
// sample: https://en.wikipedia.org/wiki/Reservoir_sampling
|
||||
if numReqs == leastReqs {
|
||||
count++
|
||||
if count > 1 || (weakrand.Int()%count) == 0 { //nolint:gosec
|
||||
if count == 1 || (weakrand.Int()%count) == 0 { //nolint:gosec
|
||||
bestHost = host
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user