If cache load fails because objects are from a different version and throw an exception, clear the cache.

This commit is contained in:
Ian Renton
2026-09-19 08:04:50 +01:00
parent 59d5f61d90
commit c9c8ffc1f7
10 changed files with 28 additions and 17 deletions
+6 -1
View File
@@ -77,7 +77,12 @@ class LiveDataCache:
logger.exception(f"Failed to write snapshot to {self._snapshot_dir}")
def _load_snapshot(self):
data = self._disk_cache.get("snapshot")
try:
data = self._disk_cache.get("snapshot")
except Exception:
logger.warning(f"Failed to load snapshot from {self._snapshot_dir}, clearing it.")
self._disk_cache.clear()
return
if not data:
return