MCPcopy
hub / github.com/kopia/kopia / maybeInitializeUpdateCheck

Method maybeInitializeUpdateCheck

cli/update_check.go:88–103  ·  view source on GitHub ↗

maybeInitializeUpdateCheck optionally writes update state file with initial update set 24 hours from now.

(ctx context.Context, co *connectOptions)

Source from the content-addressed store, hash-verified

86// maybeInitializeUpdateCheck optionally writes update state file with initial update
87// set 24 hours from now.
88func (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.
106func getLatestReleaseNameFromGitHub(ctx context.Context) (string, error) {

Calls 5

writeUpdateStateMethod · 0.95
updateStateFilenameMethod · 0.95
removeUpdateStateMethod · 0.95
NowFunction · 0.92
AddMethod · 0.45

Tested by

no test coverage detected