Skip to content

Commit

Permalink
chore: don't overwrite builtin max function (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
enocom authored Nov 13, 2024
1 parent 1981c49 commit 37fc419
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/healthcheck/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ func (c *Check) HandleReadiness(w http.ResponseWriter, _ *http.Request) {
// Proxy has not stopped.
}

if open, max := c.proxy.ConnCount(); max > 0 && open == max {
err := fmt.Errorf("max connections reached (open = %v, max = %v)", open, max)
if open, maxCount := c.proxy.ConnCount(); maxCount > 0 && open == maxCount {
err := fmt.Errorf("max connections reached (open = %v, max = %v)", open, maxCount)
c.logger.Errorf("[Health Check] Readiness failed: %v", err)
w.WriteHeader(http.StatusServiceUnavailable)
w.Write([]byte(err.Error()))
Expand Down

0 comments on commit 37fc419

Please sign in to comment.