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:
parent
c6bfc50705
commit
d81ea68dec
26 changed files with 1164 additions and 110 deletions
|
|
@ -162,6 +162,16 @@ async def publish_fire_batch(points: list[dict]) -> int:
|
|||
return len(points)
|
||||
|
||||
|
||||
async def persist_hotspots(points: list[dict]) -> int:
|
||||
"""Write a FIRMS poll to Postgres in one ON CONFLICT batch.
|
||||
|
||||
NATS-per-row was 93k commits + geofence/correlation per hotspot.
|
||||
"""
|
||||
from ingestor import ingest_fire_rows
|
||||
|
||||
return await ingest_fire_rows(points)
|
||||
|
||||
|
||||
async def ingest_fires(bbox: str | None = None) -> int:
|
||||
"""Fetch the FIRMS hotspot CSV for an area and publish it to NATS.
|
||||
|
||||
|
|
@ -206,7 +216,7 @@ async def ingest_fires(bbox: str | None = None) -> int:
|
|||
)
|
||||
continue
|
||||
points = parse_firms_csv(text)
|
||||
published = await publish_fire_batch(points)
|
||||
published = await persist_hotspots(points)
|
||||
total_published += published
|
||||
logger.info(
|
||||
"FIRMS: fetched %d hotspot(s) for bbox=%s (%s), published %d",
|
||||
|
|
|
|||
Loading…
Reference in a new issue