all: run go fix -minmax

This commit is contained in:
Aliaksandr Valialkin
2026-02-18 19:18:02 +01:00
parent 8093d98c0e
commit 84dc5453ad
22 changed files with 39 additions and 156 deletions

View File

@@ -383,10 +383,7 @@ func builtinRoutesHandler(s *server, r *http.Request, w http.ResponseWriter, rh
// Return non-OK response during grace period before shutting down the server.
// Load balancers must notify these responses and re-route new requests to other servers.
// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/463 .
d := time.Until(time.Unix(0, deadline))
if d < 0 {
d = 0
}
d := max(time.Until(time.Unix(0, deadline)), 0)
errMsg := fmt.Sprintf("The server is in delayed shutdown mode, which will end in %.3fs", d.Seconds())
http.Error(w, errMsg, http.StatusServiceUnavailable)
return true