feat: lean-Pi WS fan-out, geofences, DVR playback, fire/aircraft correlation
Phase 1: in-memory ConnectionManager viewport fan-out, 500ms map debounce, cachetools TTLCache, background masscan/ffmpeg, compose memory caps. Phase 2: PostGIS geofences + ST_Intersects alerts, Timescale 1-min CAGGs and timestamp playback, FIRMS/WFIGS x firefighting ADS-B within 20 miles. No Redis/Kafka/Celery.
This commit is contained in:
parent
8978324d33
commit
5ea9a4e879
28 changed files with 2318 additions and 50 deletions
|
|
@ -40,6 +40,7 @@ from config import (
|
|||
NATS_URL,
|
||||
)
|
||||
from keystore import get_api_key
|
||||
from upstream_cache import firms_cache
|
||||
|
||||
logger = logging.getLogger("osint.firms")
|
||||
|
||||
|
|
@ -185,12 +186,16 @@ async def ingest_fires(bbox: str | None = None) -> int:
|
|||
total_published = 0
|
||||
async with httpx.AsyncClient(timeout=FIRMS_TIMEOUT) as client:
|
||||
for dataset in datasets:
|
||||
url = FIRMS_AREA_CSV.format(
|
||||
key=map_key, dataset=dataset, bbox=area, days=FIRMS_DAYS
|
||||
)
|
||||
resp = await client.get(url)
|
||||
resp.raise_for_status()
|
||||
text = resp.text
|
||||
cache_key = (dataset, area, FIRMS_DAYS)
|
||||
text = firms_cache.get(cache_key)
|
||||
if text is None:
|
||||
url = FIRMS_AREA_CSV.format(
|
||||
key=map_key, dataset=dataset, bbox=area, days=FIRMS_DAYS
|
||||
)
|
||||
resp = await client.get(url)
|
||||
resp.raise_for_status()
|
||||
text = resp.text
|
||||
firms_cache[cache_key] = text
|
||||
# FIRMS returns HTTP 200 with a plain-text error for some failure modes
|
||||
# (bad key, invalid bbox); surface the first line for debuggability.
|
||||
if "latitude" not in text.lower()[:4096]:
|
||||
|
|
|
|||
Loading…
Reference in a new issue