mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 22:37:44 +00:00
If cache load fails because objects are from a different version and throw an exception, clear the cache.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user