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.
11 lines
412 B
Python
11 lines
412 B
Python
"""In-process TTL caches for chatty upstreams (FIRMS, RSS). No Redis."""
|
||
|
||
from __future__ import annotations
|
||
|
||
from cachetools import TTLCache
|
||
|
||
# FIRMS NRT updates every ~5–10 min; 5 min / 100 keys is enough for bbox×dataset.
|
||
firms_cache: TTLCache = TTLCache(maxsize=100, ttl=300)
|
||
|
||
# News RSS: 1 minute is enough to absorb dashboard double-clicks / retries.
|
||
rss_cache: TTLCache = TTLCache(maxsize=100, ttl=60)
|