more fixes for installation process

This commit is contained in:
Andy Miller
2025-10-17 11:31:02 -06:00
parent 654c2bb9c4
commit fe42c3344d
4 changed files with 72 additions and 5 deletions

View File

@@ -4611,6 +4611,7 @@ var SafeUpgrade = /*#__PURE__*/function () {
this.jobId = null;
this.statusFailures = 0;
this.statusContext = null;
this.statusIdleCount = 0;
this.directStatusUrl = this.resolveDirectStatusUrl();
this.preferDirectStatus = !!this.directStatusUrl;
this.registerEvents();
@@ -4678,6 +4679,7 @@ var SafeUpgrade = /*#__PURE__*/function () {
this.statusFailures = 0;
this.preferDirectStatus = !!this.directStatusUrl;
this.statusContext = null;
this.statusIdleCount = 0;
this.renderLoading();
this.modal.open();
this.fetchPreflight();
@@ -4984,6 +4986,7 @@ var SafeUpgrade = /*#__PURE__*/function () {
var jobFailed = false;
var shouldReload = false;
var handled = false;
var lastPayload = null;
console.debug('[SafeUpgrade] poll status');
var endpoint = this.resolveStatusEndpoint();
var statusUrl = endpoint.url;
@@ -5016,8 +5019,14 @@ var SafeUpgrade = /*#__PURE__*/function () {
_this6.statusContext = payload.context || null;
}
var job = payload.job || {};
lastPayload = payload;
var data = payload.progress || payload;
nextStage = data.stage || null;
if (!job || !Object.keys(job).length) {
_this6.statusIdleCount += 1;
} else {
_this6.statusIdleCount = 0;
}
_this6.renderProgress(data, job);
if (job.status === 'error') {
nextStage = 'error';
@@ -5061,6 +5070,10 @@ var SafeUpgrade = /*#__PURE__*/function () {
var delay = Math.min(5000, 1200 * Math.max(1, _this6.statusFailures));
_this6.schedulePoll(delay);
}
} else if ((!lastPayload || !lastPayload.job || !Object.keys(lastPayload.job).length) && usingDirect && _this6.statusIdleCount >= 5) {
_this6.preferDirectStatus = false;
_this6.statusFailures = 0;
_this6.schedulePoll();
} else if (jobFailed) {
_this6.stopPolling();
_this6.jobId = null;