Keep a broken DLSS cache directory from failing the build
Scanning .horizon-cache/dlss-sdk is best-effort: a permissions error or a missing directory now means "nothing cached" and the normal install path runs, instead of an exception escaping before the mods fallback. Co-Authored-By: Kimi Code <noreply@moonshot.ai>
This commit is contained in:
+7
-6
@@ -245,12 +245,13 @@ def dlss_tag_key(name):
|
||||
|
||||
def cached_dlss_sdk():
|
||||
"""Самый новый полностью скачанный SDK в кэше или None."""
|
||||
if not DLSS_CACHE.is_dir():
|
||||
return None
|
||||
for path in sorted(DLSS_CACHE.iterdir(), key=lambda p: dlss_tag_key(p.name), reverse=True):
|
||||
state = read_marker(path)
|
||||
if state and state.get("tag") == path.name and dlss_sdk_complete(path):
|
||||
return path
|
||||
try:
|
||||
for path in sorted(DLSS_CACHE.iterdir(), key=lambda p: dlss_tag_key(p.name), reverse=True):
|
||||
state = read_marker(path)
|
||||
if state and state.get("tag") == path.name and dlss_sdk_complete(path):
|
||||
return path
|
||||
except OSError:
|
||||
pass
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user