feat: fix watchtower manual run stuck states in both client and server
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 12s
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 12s
This commit is contained in:
20
admin.js
20
admin.js
@@ -646,7 +646,7 @@ async function pollWatchtowerRun(runId, attempt = 0) {
|
||||
lastManualWatchtowerRun = payload;
|
||||
renderWatchtower(latestWatchtower);
|
||||
|
||||
if (payload.running && attempt < 36) {
|
||||
if (payload.running && attempt < 60) {
|
||||
opsRefreshTimer = window.setTimeout(() => pollWatchtowerRun(runId, attempt + 1), 5000);
|
||||
return;
|
||||
}
|
||||
@@ -668,6 +668,24 @@ async function refreshOps(options = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
if (lastManualWatchtowerRun && lastManualWatchtowerRun.running) {
|
||||
try {
|
||||
const runId = lastManualWatchtowerRun.id;
|
||||
const response = await fetch(`/api/watchtower/runs/${encodeURIComponent(runId)}`, {
|
||||
cache: 'no-store',
|
||||
headers: {
|
||||
Authorization: `Bearer ${tokenSet?.id_token}`
|
||||
}
|
||||
});
|
||||
if (response.ok) {
|
||||
const payload = await response.json().catch(() => ({}));
|
||||
lastManualWatchtowerRun = payload;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Failed to refresh manual watchtower run status:', e);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/status', { cache: 'no-store' });
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
|
||||
Reference in New Issue
Block a user