mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-05-27 14:49:54 -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:
@@ -345,6 +345,9 @@ def persistent_load() -> Dict[str, Dict[str, Any]]:
|
|||||||
try:
|
try:
|
||||||
with open(path, "r") as f:
|
with open(path, "r") as f:
|
||||||
storage = unsafe_parse_yaml(f.read())
|
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:
|
except Exception as e:
|
||||||
logging.debug(f"Could not read store: {e}")
|
logging.debug(f"Could not read store: {e}")
|
||||||
if storage is None:
|
if storage is None:
|
||||||
@@ -369,11 +372,6 @@ def load_data_package_for_checksum(game: str, checksum: typing.Optional[str]) ->
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.debug(f"Could not load data package: {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
|
# cache does not match
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user