Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ func (u *Updater) Stop() {
u.wg.Wait()
}

// RunOnce runs the update check once synchronously and returns. Unlike
// Start, it does not enter a periodic loop — it performs a single check
// (checking the pinned version or latest release), applies the update if
// available, and returns. Useful for one-shot invocations from
// `pilotctl update` and similar CLI commands.
func (u *Updater) RunOnce() {
u.recoverPendingRestart()
u.checkOnce()
}

func (u *Updater) checkLoop() {
defer u.wg.Done()

Expand Down