Skip to content

Commit

Permalink
Change binary update time from 7days -> 3days
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevsaddam committed Nov 5, 2021
1 parent 3d88bcd commit 76e805a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
}

Expand Down

0 comments on commit 76e805a

Please sign in to comment.