[WIP] Fix edge upgrade edge cases

This commit is contained in:
Vladimir Stoilov
2024-09-25 16:33:45 +03:00
parent 89b533f949
commit 1b6ee722f3
6 changed files with 124 additions and 29 deletions

View File

@@ -36,7 +36,7 @@ const (
// fetching resources from the update server.
var UserAgent = fmt.Sprintf("Portmaster (%s %s)", runtime.GOOS, runtime.GOARCH)
// UpdateIndex holds the configuration for the updates module
// UpdateIndex holds the configuration for the updates module.
type UpdateIndex struct {
Directory string
DownloadDirectory string
@@ -143,7 +143,7 @@ func (u *Updates) applyUpdates(_ *mgr.WorkerCtx) error {
currentBundle := u.registry.bundle
downloadBundle := u.downloader.bundle
log.Infof("update: starting update: %s %s -> %s", currentBundle.Name, currentBundle.Version, downloadBundle.Version)
err := u.registry.performUpgrade(u.downloader.dir, u.downloader.indexFile)
err := u.registry.performRecoverableUpgrade(u.downloader.dir, u.downloader.indexFile)
if err != nil {
// TODO(vladimir): Send notification to UI
log.Errorf("updates: failed to apply updates: %s", err)