MCPcopy
hub / github.com/safing/portmaster / upgradeWorker

Method upgradeWorker

service/updates/module.go:464–478  ·  view source on GitHub ↗
(w *mgr.WorkerCtx)

Source from the content-addressed store, hash-verified

462}
463
464func (u *Updater) upgradeWorker(w *mgr.WorkerCtx) error {
465 err := u.updateAndUpgrade(w, u.getIndexURLsWithLock(), false, true)
466 switch {
467 case err == nil:
468 return nil // Success!
469 case errors.Is(err, ErrSameIndex):
470 return nil // Nothing to do.
471 case errors.Is(err, ErrNoUpdateAvailable):
472 return nil // Already logged.
473 case errors.Is(err, ErrActionRequired) && !u.cfg.Notify:
474 return fmt.Errorf("user action required, but notifying user is disabled: %w", err)
475 default:
476 return fmt.Errorf("udpating failed: %w", err)
477 }
478}
479
480// ForceUpdate executes a forced update and upgrade directly and synchronously
481// and is intended to be used only within a tool, not a service.

Callers

nothing calls this directly

Calls 4

updateAndUpgradeMethod · 0.95
getIndexURLsWithLockMethod · 0.95
ErrorfMethod · 0.80
IsMethod · 0.45

Tested by

no test coverage detected