mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-29 12:23:21 -07:00
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:
8
Utils.py
8
Utils.py
@@ -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 {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user