mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-25 15:52:45 -04: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…
x
Reference in New Issue
Block a user