fix periodic snapshot upgrade edge cases

This commit is contained in:
2026-06-29 16:53:10 +08:00
parent fe8d4fcb14
commit 4ca08a12a4
2 changed files with 47 additions and 2 deletions

View File

@@ -497,7 +497,14 @@ import sys
runs_root = pathlib.Path(sys.argv[1])
delta_count = 0
run_dirs = sorted(
[path for path in runs_root.glob("run_[0-9][0-9][0-9][0-9]") if path.is_dir()],
[
path
for path in runs_root.glob("run_*")
if path.is_dir()
and path.name.startswith("run_")
and path.name[4:].isdigit()
],
key=lambda path: int(path.name[4:]),
reverse=True,
)
for run_dir in run_dirs: