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

Method updateCheckWorker

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

Source from the content-addressed store, hash-verified

446}
447
448func (u *Updater) updateCheckWorker(w *mgr.WorkerCtx) error {
449 err := u.updateAndUpgrade(w, u.getIndexURLsWithLock(), false, false)
450 switch {
451 case err == nil:
452 return nil // Success!
453 case errors.Is(err, ErrSameIndex):
454 return nil // Nothing to do.
455 case errors.Is(err, ErrNoUpdateAvailable):
456 return nil // Already logged.
457 case errors.Is(err, ErrActionRequired) && !u.cfg.Notify:
458 return fmt.Errorf("user action required, but notifying user is disabled: %w", err)
459 default:
460 return fmt.Errorf("udpating failed: %w", err)
461 }
462}
463
464func (u *Updater) upgradeWorker(w *mgr.WorkerCtx) error {
465 err := u.updateAndUpgrade(w, u.getIndexURLsWithLock(), false, true)

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