Skip to content

Commit

Permalink
Merge pull request #298 from Michad/fix-release-failure
Browse files Browse the repository at this point in the history
fix: decrease max timeout value to int32 levels to fix release build …
  • Loading branch information
Michad authored Oct 18, 2024
2 parents 3322f74 + ddc0e9c commit a3b951c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/server/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit a3b951c

Please sign in to comment.