Improve speed

This commit is contained in:
Kevin
2026-05-22 11:15:22 +08:00
parent 87b6a7b804
commit 941c71e991
14 changed files with 132 additions and 49 deletions

View File

@@ -37,8 +37,9 @@ def test_purge_batch_artifacts_removes_cache_and_uploads(tmp_path: Path) -> None
digest = "d" * 64
candidate_key = "c1"
cache_entry = root / "cache" / digest / candidate_key
(cache_entry / "input").mkdir(parents=True)
(cache_entry / "input" / "input.mp4").write_bytes(b"x" * 100)
pipeline_input = root / "cache" / digest / "input" / "pipeline.mp4"
pipeline_input.parent.mkdir(parents=True)
pipeline_input.write_bytes(b"x" * 100)
(cache_entry / "output").mkdir(parents=True)
(cache_entry / "output" / "result.tsv").write_text("ok\n", encoding="utf-8")
(cache_entry / "work").mkdir(parents=True)
@@ -53,6 +54,7 @@ def test_purge_batch_artifacts_removes_cache_and_uploads(tmp_path: Path) -> None
purge_surgery_batch_tree(root, surgery_id)
assert not cache_entry.exists()
assert pipeline_input.is_file()
assert not (root / surgery_id).exists()