Add update install progress feedback and collector metrics line

This commit is contained in:
Sucukdeluxe
2026-03-01 03:33:18 +01:00
parent cb1e4bb0c1
commit 508977e70b
10 changed files with 317 additions and 37 deletions
+3 -2
View File
@@ -9,6 +9,7 @@ import {
StartConflictResolutionResult,
UiSnapshot,
UpdateCheckResult,
UpdateInstallProgress,
UpdateInstallResult
} from "../shared/types";
import { importDlcContainers } from "./container";
@@ -139,12 +140,12 @@ export class AppController {
return result;
}
public async installUpdate(): Promise<UpdateInstallResult> {
public async installUpdate(onProgress?: (progress: UpdateInstallProgress) => void): Promise<UpdateInstallResult> {
const cacheAgeMs = Date.now() - this.lastUpdateCheckAt;
const cached = this.lastUpdateCheck && !this.lastUpdateCheck.error && cacheAgeMs <= 10 * 60 * 1000
? this.lastUpdateCheck
: undefined;
const result = await installLatestUpdate(this.settings.updateRepo, cached);
const result = await installLatestUpdate(this.settings.updateRepo, cached, onProgress);
if (result.started) {
this.lastUpdateCheck = null;
this.lastUpdateCheckAt = 0;