Cleanup for lock driven numbered directories.
(
root: Path, prefix: str, keep: int, consider_lock_dead_if_created_before: float
)
| 336 | |
| 337 | |
| 338 | def cleanup_numbered_dir( |
| 339 | root: Path, prefix: str, keep: int, consider_lock_dead_if_created_before: float |
| 340 | ) -> None: |
| 341 | """Cleanup for lock driven numbered directories.""" |
| 342 | for path in cleanup_candidates(root, prefix, keep): |
| 343 | try_cleanup(path, consider_lock_dead_if_created_before) |
| 344 | for path in root.glob("garbage-*"): |
| 345 | try_cleanup(path, consider_lock_dead_if_created_before) |
| 346 | |
| 347 | |
| 348 | def make_numbered_dir_with_cleanup( |