Refactor of caching & data storage part 8 #118

This commit is contained in:
Ian Renton
2026-08-01 11:13:02 +01:00
parent 41aecc6007
commit 5bfe480f7c
6 changed files with 106 additions and 41 deletions
+6
View File
@@ -16,10 +16,12 @@ class DataStore:
lookup data using different caching strategies for each."""
def __init__(self):
# Constants
self._MAX_SPOT_COUNT = 100000
self._MAX_ALERT_COUNT = 100000
self._SPOT_ALERT_SNAPSHOT_INTERVAL_SEC = 300
self._CALLSIGN_DATA_TTL_SEC = 30 * 24 * 60 * 60
# Caches
self.alerts = None
self.spots = None
self.callsigns = None
@@ -30,6 +32,10 @@ class DataStore:
self._status = None
self.solar_conditions = None
self._solar = None
# ITU/CQ zone GeoJSON data is only ever loaded statically from a local file so these don't even need to be
# caches, they can just be straight objects
self.cq_zone_data = None
self.itu_zone_data = None
def setup(self):
Path(CACHE_DIR).mkdir(parents=True, exist_ok=True)