fix: pipeline reliability — WS, summarizer, ingest, health

Stop the live HUD reconnect storm (nginx WS snippet + backoff), copy
intel/nous_client into the summarizer image, and make event ingest
idempotent on URL. GDELT uses the DOC API; NWS no longer sends bbox;
FIRMS is one ON CONFLICT batch; GET /api/aircraft serves last-known.
Health reports freshness without 503ing docker. EONET + CISA KEV added.
This commit is contained in:
Sirius DevOps 2026-08-28 21:49:05 -04:00
commit d81ea68dec
26 changed files with 1164 additions and 110 deletions

View file

@ -1149,9 +1149,12 @@ async function checkHealth() {
try {
const r = await fetch(`${API}/api/health`);
const d = await r.json();
if (r.ok) {
if (r.ok && d && d.status === 'ok') {
dot.className = 'dot ok';
txt.textContent = 'SYSTEMS OK';
} else if (r.ok) {
dot.className = 'dot bad';
txt.textContent = 'DEGRADED';
} else {
dot.className = 'dot bad';
txt.textContent = 'DEGRADED';
@ -1307,8 +1310,7 @@ function initMarketTicker() {
loadMarketSymbols();
buildMarketTrack(true);
setMarketTag('standby');
probeMarket();
setInterval(probeMarket, MARKET_POLL_MS);
// GET /api/market is not wired — do not 404-poll every 15s.
}
/* ═══════════════ NEWS FEED + TICKER ═══════════════ */
@ -1813,6 +1815,7 @@ function bboxCell() {
return currentBBox().split(',').map(n => Number(n).toFixed(2)).join(',') + '@' + map.getZoom();
}
let liveWs = null;
let wsRetryMs = 1000;
const FF_ICAO = new Set(['AT802','AT8T','AT8P','C130','C30J','C130J','DC10','MD10','MD87','S64','UH60','S70','CL415','CL215','B350','OV10','C208']);
let firefighterHex = new Set();
let dvrTs = null;
@ -1876,15 +1879,25 @@ function acColor(p) {
}
function connectLiveWs() {
if (liveWs && (liveWs.readyState === 0 || liveWs.readyState === 1)) return;
try { liveWs = new WebSocket(liveWsUrl()); } catch (e) { return; }
liveWs.onopen = () => sendLiveViewport();
try { liveWs = new WebSocket(liveWsUrl()); } catch (e) {
const delay = wsRetryMs;
wsRetryMs = Math.min(wsRetryMs * 2, 60000);
setTimeout(connectLiveWs, delay);
return;
}
liveWs.onopen = () => { wsRetryMs = 1000; sendLiveViewport(); };
liveWs.onmessage = (ev) => {
try {
const msg = JSON.parse(ev.data);
applyLiveMarker(msg.type, msg.payload);
} catch (e) { /* ignore malformed */ }
};
liveWs.onclose = () => { liveWs = null; setTimeout(connectLiveWs, 4000); };
liveWs.onclose = () => {
liveWs = null;
const delay = wsRetryMs;
wsRetryMs = Math.min(wsRetryMs * 2, 60000);
setTimeout(connectLiveWs, delay);
};
}
function overlayFetch(url) {
return fetch(url, overlayAbort ? { signal: overlayAbort.signal } : {});
@ -2022,12 +2035,16 @@ async function initMap() {
trainsOn = document.getElementById('lp-trains-on').checked;
vesselsOn = document.getElementById('lp-vessels-on').checked;
stormsOn = document.getElementById('lp-storms-on').checked;
if (firesOn) loadFires();
if (camsOn) loadCams();
if (blipsOn) loadBlips();
if (newsOn) loadNewsPins();
refreshLiveOverlays();
connectLiveWs();
requestAnimationFrame(() => {
if (firesOn) loadFires();
setTimeout(() => {
if (camsOn) loadCams();
if (blipsOn) loadBlips();
if (newsOn) loadNewsPins();
refreshLiveOverlays();
}, 250);
});
} catch(e) {
hint.textContent = `Failed to load map layers: ${e.message || e}`;
console.error('Map init failed', e);