(w *mgr.WorkerCtx)
| 462 | } |
| 463 | |
| 464 | func (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. |
nothing calls this directly
no test coverage detected