Skip to content

Commit 1665db5

Browse files
strandedturtleclaude
andcommitted
Update all: start every update immediately (parallel)
'Update all' awaited each container's full update before starting the next, so they ran one at a time. Fire them all at once with Promise.allSettled instead — each card's update + live log stream runs concurrently, and a failure on one doesn't affect the others. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Lj6nYJQDtLaZFvvEQJGM4
1 parent 0c29d3d commit 1665db5

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

client/src/components/UpdateAllButton.jsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useCallback, useState } from 'react';
22

33
/**
4-
* Updates every container with `updateAvailable && !pinned`, sequentially:
5-
* each one is started and fully awaited (start + SSE stream to completion,
6-
* handled by `runUpdate`) before the next one begins. A failure on one
7-
* container does not stop the batch — `runUpdate` is expected to resolve
8-
* (not reject) even on failure, so this loop always continues.
4+
* Updates every container with `updateAvailable && !pinned`, all at once:
5+
* each is started immediately and its own SSE stream runs concurrently
6+
* (handled by `runUpdate`). A failure on one container does not affect the
7+
* others — `runUpdate` resolves (not rejects) even on failure, and
8+
* `Promise.allSettled` waits for them all regardless.
99
*
1010
* Disabled when there are no eligible targets or any update is in flight.
1111
*/
@@ -15,13 +15,8 @@ export default function UpdateAllButton({ targets, runUpdate, disabled }) {
1515
const handleClick = useCallback(async () => {
1616
if (running || disabled || targets.length === 0) return;
1717
setRunning(true);
18-
for (const name of targets) {
19-
try {
20-
await runUpdate(name);
21-
} catch {
22-
// Swallow — a failure for one container must not stop the batch.
23-
}
24-
}
18+
// Fire them all immediately, then wait for the whole batch to settle.
19+
await Promise.allSettled(targets.map((name) => runUpdate(name)));
2520
setRunning(false);
2621
}, [running, disabled, targets, runUpdate]);
2722

0 commit comments

Comments
 (0)