Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Dec 5, 2024
1 parent ac16e93 commit 5e836c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ func (s *site) nextProxy() (*Backend, func()) {
}
switch globalHostBalance {
case "least":
min := int64(math.MaxInt64)
minCall := int64(math.MaxInt64)
earliest := int64(math.MaxInt64)
idx := 0
// Shuffle before picking the least connection to ensure all nodes
Expand All @@ -590,8 +590,8 @@ func (s *site) nextProxy() (*Backend, func()) {
})
for i, backend := range backends {
currentCalls := backend.Stats.CurrentCalls.Load()
if currentCalls < min {
min = currentCalls
if currentCalls < minCall {
minCall = currentCalls
lastFinished := backend.Stats.LastFinished.Load()
if lastFinished < earliest {
earliest = lastFinished
Expand Down

0 comments on commit 5e836c2

Please sign in to comment.