maybeInitializeUpdateCheck optionally writes update state file with initial update set 24 hours from now.
(ctx context.Context, co *connectOptions)
| 86 | // maybeInitializeUpdateCheck optionally writes update state file with initial update |
| 87 | // set 24 hours from now. |
| 88 | func (c *App) maybeInitializeUpdateCheck(ctx context.Context, co *connectOptions) { |
| 89 | if co.connectCheckForUpdates { |
| 90 | us := &updateState{ |
| 91 | NextCheckTime: clock.Now().Add(c.initialUpdateCheckDelay), |
| 92 | NextNotifyTime: clock.Now().Add(c.initialUpdateCheckDelay), |
| 93 | } |
| 94 | if err := c.writeUpdateState(us); err != nil { |
| 95 | log(ctx).Debug("error initializing update state") |
| 96 | return |
| 97 | } |
| 98 | |
| 99 | log(ctx).Infof(autoUpdateNotice, c.updateStateFilename()) |
| 100 | } else { |
| 101 | c.removeUpdateState() |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | // getLatestReleaseNameFromGitHub gets the name of the release marked 'latest' on GitHub. |
| 106 | func getLatestReleaseNameFromGitHub(ctx context.Context) (string, error) { |
no test coverage detected