From ddc0e9c03c00d3a14f79b5abae668cea0148aee2 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 18 Oct 2024 13:27:01 -0400 Subject: [PATCH] fix: decrease max timeout value to int32 levels to fix release build failure --- internal/server/health.go | 4 ++-- internal/server/server.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/server/health.go b/internal/server/health.go index fbebccc..c94d7a3 100644 --- a/internal/server/health.go +++ b/internal/server/health.go @@ -223,8 +223,8 @@ func setupCheckRoutines(ctx context.Context, h config.HealthConfig, layerGroup * for i, check := range checks { delay := check.GetDelay() - if delay > math.MaxInt64 { - delay = math.MaxInt64 + if delay > math.MaxInt32 { + delay = math.MaxInt32 } ttl := time.Second * time.Duration(delay) // #nosec G115 diff --git a/internal/server/server.go b/internal/server/server.go index 0670db2..8c48b4e 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -99,8 +99,8 @@ func setupHandlers(config *config.Config, layerGroup *layer.LayerGroup, auth aut rootHandler = handlers.CompressHandler(rootHandler) } - if config.Server.Timeout > math.MaxInt64 { - config.Server.Timeout = math.MaxInt64 + if config.Server.Timeout > math.MaxInt32 { + config.Server.Timeout = math.MaxInt32 } rootHandler = httpContextHandler{rootHandler, config.Error}