Skip to content

Commit

Permalink
Set timeout on update check
Browse files Browse the repository at this point in the history
  • Loading branch information
amisevsk committed Jul 18, 2024
1 parent 38cff18 commit 60420e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/lib/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"path/filepath"
"regexp"
"strings"
"time"

"kitops/pkg/lib/constants"
"kitops/pkg/output"
Expand Down Expand Up @@ -64,7 +65,10 @@ func CheckForUpdate(configHome string) {
return
}

resp, err := http.Get(releaseUrl)
client := &http.Client{
Timeout: 1 * time.Second,
}
resp, err := client.Get(releaseUrl)
if err != nil {
output.Debugf("Failed to check for updates: %s", err)
return
Expand Down

0 comments on commit 60420e3

Please sign in to comment.