osint-dashboard/app/upstream_cache.py

12 lines
412 B
Python
Raw Normal View History

"""In-process TTL caches for chatty upstreams (FIRMS, RSS). No Redis."""
from __future__ import annotations
from cachetools import TTLCache
# FIRMS NRT updates every ~510 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)