diff --git a/app/ui/ui.go b/app/ui/ui.go index 88b2d5608..3ff081b27 100644 --- a/app/ui/ui.go +++ b/app/ui/ui.go @@ -109,18 +109,10 @@ type Server struct { Dev bool // Updater for checking and downloading updates - Updater UpdaterInterface + Updater *updater.Updater UpdateAvailableFunc func() } -// UpdaterInterface defines the methods we need from the updater -type UpdaterInterface interface { - CheckForUpdate(ctx context.Context) (bool, string, error) - InstallAndRestart() error - CancelOngoingDownload() - TriggerImmediateCheck() -} - func (s *Server) log() *slog.Logger { if s.Logger == nil { return slog.Default() diff --git a/app/updater/updater.go b/app/updater/updater.go index c5a2f2efa..efaddc875 100644 --- a/app/updater/updater.go +++ b/app/updater/updater.go @@ -279,7 +279,11 @@ func (u *Updater) CancelOngoingDownload() { // TriggerImmediateCheck signals the background checker to check for updates immediately func (u *Updater) TriggerImmediateCheck() { if u.checkNow != nil { - u.checkNow <- struct{}{} + select { + case u.checkNow <- struct{}{}: + default: + // Check already pending, no need to queue another + } } }