Skip to content

Commit

Permalink
fix missing default
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarreira committed Oct 27, 2022
1 parent 80902c1 commit ab245ac
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tsuru/config/selfupdater/uptodate.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ var (
stderr io.ReadWriter = os.Stderr
nowUTC func() time.Time = func() time.Time { return time.Now().UTC() } // so we can test time-dependent features
snoozeDuration time.Duration
forceCheckAfterDuration time.Duration
overrideForceCheck *bool = nil
zeroTime time.Time
forceCheckAfterDuration time.Duration = 3 * 30 * 24 * time.Hour
overrideForceCheck *bool
)

func init() {
Expand Down Expand Up @@ -132,7 +131,7 @@ func CheckLatestVersionBackground(currentVersion string) *latestVersionCheck {
conf := config.GetConfig()

forceCheckBeforeFinish := false
if conf.ClientSelfUpdater.LastCheck != zeroTime || overrideForceCheck != nil { // do not force on empty config.ClientSelfUpdater
if !conf.ClientSelfUpdater.LastCheck.IsZero() || overrideForceCheck != nil { // do not force on empty config.ClientSelfUpdater
forceCheckBeforeFinish = conf.ClientSelfUpdater.LastCheck.Add(forceCheckAfterDuration).Before(nowUTC())
if overrideForceCheck != nil {
forceCheckBeforeFinish = *overrideForceCheck
Expand Down

0 comments on commit ab245ac

Please sign in to comment.