From bb3d591f215f224dc13258eb013adab56f972ddd Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Mon, 11 Dec 2023 15:14:49 -0500 Subject: [PATCH] remove cli update notification delay --- cli/packages/util/check-for-update.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cli/packages/util/check-for-update.go b/cli/packages/util/check-for-update.go index 9921cef0d..ad07cb1d4 100644 --- a/cli/packages/util/check-for-update.go +++ b/cli/packages/util/check-for-update.go @@ -28,9 +28,9 @@ func CheckForUpdate() { return } - daysSinceRelease, _ := daysSinceDate(publishedDate) + // daysSinceRelease, _ := daysSinceDate(publishedDate) - if latestVersion != CLI_VERSION && daysSinceRelease > 2 { + if latestVersion != CLI_VERSION { yellow := color.New(color.FgYellow).SprintFunc() blue := color.New(color.FgCyan).SprintFunc() black := color.New(color.FgBlack).SprintFunc() @@ -151,15 +151,15 @@ func IsRunningInDocker() bool { return strings.Contains(string(cgroup), "docker") } -func daysSinceDate(dateString string) (int, error) { - layout := "2006-01-02T15:04:05Z" - parsedDate, err := time.Parse(layout, dateString) - if err != nil { - return 0, err - } +// func daysSinceDate(dateString string) (int, error) { +// layout := "2006-01-02T15:04:05Z" +// parsedDate, err := time.Parse(layout, dateString) +// if err != nil { +// return 0, err +// } - currentTime := time.Now() - difference := currentTime.Sub(parsedDate) - days := int(difference.Hours() / 24) - return days, nil -} +// currentTime := time.Now() +// difference := currentTime.Sub(parsedDate) +// days := int(difference.Hours() / 24) +// return days, nil +// }