Skip to content

Commit eff7c1c

Browse files
committed
Skip previously failed downloads
1 parent 88327aa commit eff7c1c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

micall/utils/analyze_kive_batches/download.py

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ def process_info(root: DirPath, info: Mapping[str, object]) -> Optional[str]:
1717
run_id = str(info["id"])
1818
output = root / "runs" / run_id
1919
info_path = output / "info.json"
20+
failed_path = output / "failed"
21+
22+
if failed_path.exists():
23+
logger.warning("Skipping RUN_ID %s - download failed last time.", run_id)
24+
return None
2025

2126
if info_path.exists():
2227
logger.debug("Directory for RUN_ID %s already exists.", run_id)
@@ -47,6 +52,7 @@ def process_info(root: DirPath, info: Mapping[str, object]) -> Optional[str]:
4752

4853
except BaseException as ex:
4954
logger.warning("Could not download run %s: %s", run_id, ex)
55+
failed_path.touch()
5056
return None
5157

5258

0 commit comments

Comments
 (0)