示例#1
0
func (u *Updater) wantUpdate() bool {
	path := filepath.Join(updateDir, upcktimePath)
	if !version.Tagged() || readTime(path).After(time.Now()) {
		return false
	}
	wait := 12*time.Hour + randDuration(8*time.Hour)
	return writeTime(path, time.Now().Add(wait))
}
示例#2
0
func runUpdate() error {
	if updater == nil || !version.Tagged() {
		return errors.New("Dev builds don't support auto-updates")
	}
	return updater.update()
}