From 76e805ad3124a4dfb8a16664ea9580d76d07d055 Mon Sep 17 00:00:00 2001 From: Saddam H Date: Thu, 4 Nov 2021 13:00:57 +0600 Subject: [PATCH] Change binary update time from 7days -> 3days --- update/update.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/update/update.go b/update/update.go index 085ba7f..6e830ad 100644 --- a/update/update.go +++ b/update/update.go @@ -12,11 +12,12 @@ import ( ) const ( - layoutISO = "2006-01-02" + layoutISO = "2006-01-02" + updateInDays = 3 ) // SelfUpdate update the application to its latest version -// if the current release is 7days old and has a new update +// if the current release is 3days old and has a new update func SelfUpdate(ctx context.Context, buildDate, version string) error { if buildDate == "unknown" { return errors.New("update: unable to update based on unkown build date/version") @@ -25,7 +26,7 @@ func SelfUpdate(ctx context.Context, buildDate, version string) error { if err != nil { return fmt.Errorf("update: %v", err) } - if (time.Since(currBinaryReleaseDate).Hours() / 24) <= 7 { + if (time.Since(currBinaryReleaseDate).Hours() / 24) <= updateInDays { return nil }