diff --git a/core/live_data_cache.py b/core/live_data_cache.py index 6fb61e4..34e35d8 100644 --- a/core/live_data_cache.py +++ b/core/live_data_cache.py @@ -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 diff --git a/core/single_object_data_cache.py b/core/single_object_data_cache.py index 66b1d7f..f4d164a 100644 --- a/core/single_object_data_cache.py +++ b/core/single_object_data_cache.py @@ -21,7 +21,13 @@ class SingleObjectDataCache: # This cache stores a single object, doesn't matter what it's called so "object" will do if "object" not in self._cache: self._cache.add("object", object_if_empty) - self._obj = self._cache.get("object") + try: + self._obj = self._cache.get("object") + except Exception: + logger.warning(f"Failed to load cache from {cache_dir}, clearing it.") + self._cache.clear() + self._cache.add("object", object_if_empty) + self._obj = object_if_empty def get(self): """Get the data object. This can then be manipulated as necessary across multiple threads. Any function diff --git a/templates/add_spot.html b/templates/add_spot.html index b629870..3d9632a 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -77,7 +77,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index a3b58e0..db16f4b 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -83,7 +83,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index dc7a4df..4c6b19d 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -76,8 +76,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 75a8643..27c8fae 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -16,10 +16,10 @@ window.fetchEventSource = fetchEventSource; - - - - + + + + {% end %} {% block body %}