From 5e836c2219199d60472cf95fa76cf87a635038a2 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Thu, 5 Dec 2024 17:13:37 +0100 Subject: [PATCH] Fix lint --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 0d37cfd..8636c6a 100644 --- a/main.go +++ b/main.go @@ -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 @@ -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