fix: reload authoritative host health history

Refresh host health from the persisted retention-filtered history after batch completion, allowing the existing generation guard to reject stale responses and removing the competing local merge path.
This commit is contained in:
Sucukdeluxe
2026-08-16 23:25:42 +02:00
parent 5ace779b14
commit 2eaa30c0a8
4 changed files with 139 additions and 113 deletions
-18
View File
@@ -39,23 +39,6 @@
return out;
}
function mergeHosterHealthHistory(history, batch) {
if (!Array.isArray(history)) return history;
if (!batch?.id) return [...history, batch];
const merged = [];
let replaced = false;
for (const existing of history) {
if (existing?.id === batch.id) {
if (!replaced) merged.push(batch);
replaced = true;
} else {
merged.push(existing);
}
}
if (!replaced) merged.push(batch);
return merged;
}
function summarizeHosterHealth(history, options = {}) {
const out = {};
const hosters = options.hosters && typeof options.hosters === 'object' ? options.hosters : {};
@@ -297,7 +280,6 @@
const api = {
summarizePerHoster,
mergeHosterHealthHistory,
summarizeHosterHealth,
classifyErrorCategory,
summarizeBatchErrors,