fix: skip scratch downloads in the restore scan

This commit is contained in:
Abdessamad Derraz committed 2026-11-05 11:40:17 +01:00
1 parent d38cd58036
commit 28a8eec1c4
2 files changed
+34

No files matched your search

+5
View File
@@ -40,6 +40,11 @@ def index_cache(cache_dir: str) -> dict[str, str]:
"""Map SHA1 to cached file path for every asset in the cache."""
index: dict[str, str] = {}
for name in sorted(os.listdir(cache_dir)):
# A download in progress writes `<asset>.<random>.tmp` beside the
# cache and renames it when done: it is partial, and may be gone by
# the time it is opened.
if name.endswith(".tmp"):
continue
path = os.path.join(cache_dir, name)
if not os.path.isfile(path):
continue