(w *mgr.WorkerCtx)
| 446 | } |
| 447 | |
| 448 | func (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 | |
| 464 | func (u *Updater) upgradeWorker(w *mgr.WorkerCtx) error { |
| 465 | err := u.updateAndUpgrade(w, u.getIndexURLsWithLock(), false, true) |
nothing calls this directly
no test coverage detected