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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user