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:
17
server.js
17
server.js
@@ -461,12 +461,25 @@ async function getWatchtowerRun(runId) {
|
||||
}
|
||||
|
||||
if (manualWatchtowerRuns.has(id)) {
|
||||
return manualWatchtowerRuns.get(id);
|
||||
const cached = manualWatchtowerRuns.get(id);
|
||||
if (!cached.running) {
|
||||
return cached;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return await readWatchtowerRunContainer(id);
|
||||
const livePayload = await readWatchtowerRunContainer(id);
|
||||
manualWatchtowerRuns.set(id, livePayload);
|
||||
|
||||
if (!livePayload.running) {
|
||||
removeContainer(id).catch(() => {});
|
||||
}
|
||||
|
||||
return livePayload;
|
||||
} catch (error) {
|
||||
if (manualWatchtowerRuns.has(id)) {
|
||||
return manualWatchtowerRuns.get(id);
|
||||
}
|
||||
error.statusCode = error.statusCode || 404;
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user