mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 02:21:42 +00:00
Refactor of caching & data storage part 5 #118
This commit is contained in:
+4
-4
@@ -43,11 +43,11 @@ class DataStore:
|
||||
self.status_data = self._status.get("status_data")
|
||||
|
||||
# Standard disk cache for SIG ref data. Separate provider threads will repopulate theis on a regular basis
|
||||
# but there's no need for a TTL since old data is better than no data. This is a two-layer dict, keys are SIG
|
||||
# name and then reference ID, with the final value being a SIGRef object.
|
||||
# but there's no need for a TTL since old data is better than no data. We need to key on both SIG and reference,
|
||||
# and trying to do two layers of dict in diskcache absolutely destroys performance with unpickling huge dicts,
|
||||
# so we have an ugly "SIG:ref" syntax for keys to keep it a single level.
|
||||
self.sigrefs = diskcache.Cache(self._CACHE_DIR + "/sigrefs")
|
||||
for k in list(self.sigrefs.iterkeys()):
|
||||
logging.info(f"Loaded data for %d references in %s SIG.", len(self.sigrefs[k]), k)
|
||||
logging.info(f"Loaded data for %d SIG references.", len(self.sigrefs))
|
||||
|
||||
# Standard disk cache for callsign data. This data does have a TTL to trigger an occasional re-lookup.
|
||||
# Old data *is* better than no data, but we can't have a background thread re-looking-up every callsign
|
||||
|
||||
Reference in New Issue
Block a user