diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-27 20:16:26 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-27 20:16:26 +1000 |
commit | 38557f131dc1abef3dcc42dfbaa94bf410f209ca (patch) | |
tree | 10e11d9948e15bf300e2adb299ff2f9240e90471 /pkg/updates | |
parent | 96eef7838ee0402ada15a9509a7f08a811b81cd3 (diff) |
record last update check as soon as you begin checking
Diffstat (limited to 'pkg/updates')
-rw-r--r-- | pkg/updates/updates.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/updates/updates.go b/pkg/updates/updates.go index 545f6bf83..ad9259cc6 100644 --- a/pkg/updates/updates.go +++ b/pkg/updates/updates.go @@ -90,6 +90,10 @@ func (u *Updater) majorVersionDiffers(oldVersion, newVersion string) bool { func (u *Updater) checkForNewUpdate() (string, error) { u.Log.Info("Checking for an updated version") + if err := u.RecordLastUpdateCheck(); err != nil { + return "", err + } + newVersion, err := u.getLatestVersionNumber() if err != nil { return "", err @@ -97,10 +101,6 @@ func (u *Updater) checkForNewUpdate() (string, error) { u.Log.Info("Current version is " + u.Config.GetVersion()) u.Log.Info("New version is " + newVersion) - if err := u.RecordLastUpdateCheck(); err != nil { - return "", err - } - if newVersion == u.Config.GetVersion() { return "", errors.New("You already have the latest version") } |