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 dce07b6 commit 9c25f0e
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 @@ -13,6 +13,7 @@ import (
"path/filepath"
"regexp"
"strings"
"time"

"golang.org/x/mod/semver"
)
Expand Down Expand Up @@ -47,7 +48,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 9c25f0e

Please sign in to comment.