diff --git a/version/version.go b/version/version.go index 20d53070..e2c5b151 100644 --- a/version/version.go +++ b/version/version.go @@ -17,9 +17,10 @@ type githubRelease struct { } var latestRelease = "" +var lastVersionCheck = time.Time{} func GetLatestReleaseTag() string { - if latestRelease != "" { + if latestRelease != "" && time.Since(lastVersionCheck) < 5*time.Minute { return latestRelease } url := "https://api.github.com/repos/getAlby/nostr-wallet-connect-next/releases" @@ -75,5 +76,7 @@ func GetLatestReleaseTag() string { "current": Tag, }).Info("Found latest github release") + lastVersionCheck = time.Now() + return latestRelease }