Clients: remove datapackage from persistent_storage ... (#6074)

... next time it gets written to.
This makes loading peristent_storage faster in the future.
This commit is contained in:
black-sliver
2026-03-29 17:43:26 +00:00
committed by GitHub
parent 645f25a94e
commit cf47cc67c0

View File

@@ -345,6 +345,9 @@ def persistent_load() -> Dict[str, Dict[str, Any]]:
try:
with open(path, "r") as f:
storage = unsafe_parse_yaml(f.read())
if "datapackage" in storage:
del storage["datapackage"]
logging.debug("Removed old datapackage from persistent storage")
except Exception as e:
logging.debug(f"Could not read store: {e}")
if storage is None:
@@ -369,11 +372,6 @@ def load_data_package_for_checksum(game: str, checksum: typing.Optional[str]) ->
except Exception as e:
logging.debug(f"Could not load data package: {e}")
# fall back to old cache
cache = persistent_load().get("datapackage", {}).get("games", {}).get(game, {})
if cache.get("checksum") == checksum:
return cache
# cache does not match
return {}