Merge pull request 'Run multi-target commands in parallel' (#75) from parallel-targets into main
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (push) Successful in 20s
CI / Lint (eslint) (push) Successful in 29s
CI / Security (npm audit) (push) Successful in 15s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m1s
CI / Integration (api) (push) Successful in 2m50s
CI / UI (playwright) (push) Successful in 1m56s
CI / Deploy (push) Successful in 14s
CI / Deploy worker (push) Successful in 8s
CI / Notify (push) Successful in 3s

This commit was merged in pull request #75.
This commit is contained in:
jared committed 2026-11-23 13:15:17 -05:00
commit a945cd80d3
4 files changed
+63 -33

No files matched your search

+7 -9
View File
@@ -248,21 +248,19 @@
return;
}
renderExecuting(workerIds.length);
const results = [];
let successCount = 0;
let failCount = 0;
for (const workerId of workerIds) {
// Send to every selected worker at once (#26); results keep the selection order.
const results = await Promise.all(workerIds.map(async (workerId) => {
const worker = _workers.find(w => w.id === workerId);
const workerLabel = worker ? worker.name : workerId;
try {
const data = await Pulse.api.post('/api/workers/' + encodeURIComponent(workerId) + '/command', { command });
results.push({ worker: workerLabel, success: true, executionId: data && data.execution_id });
successCount++;
return { worker: workerLabel, success: true, executionId: data && data.execution_id };
} catch (e) {
results.push({ worker: workerLabel, success: false, error: e.message || 'Failed to execute' });
failCount++;
return { worker: workerLabel, success: false, error: e.message || 'Failed to execute' };
}
}
}));
const successCount = results.filter(r => r.success).length;
const failCount = results.length - successCount;
addToHistory(command, workerIds.length + ' workers');
renderMultiResult(results, successCount, failCount);
if (failCount === 0) Pulse.beep('success');