Check if a lock is stale (all holder processes are dead). Args: lock_file_path: Path to the lock file Returns: True if lock is stale, False if still active or no lock exists
(lock_file_path: Path)
| 90 | |
| 91 | |
| 92 | def is_lock_stale(lock_file_path: Path) -> bool: |
| 93 | """ |
| 94 | Check if a lock is stale (all holder processes are dead). |
| 95 | |
| 96 | Args: |
| 97 | lock_file_path: Path to the lock file |
| 98 | |
| 99 | Returns: |
| 100 | True if lock is stale, False if still active or no lock exists |
| 101 | """ |
| 102 | db = get_lock_database(lock_file_path) |
| 103 | lock_name = str(lock_file_path) |
| 104 | return db.is_lock_stale(lock_name) |
| 105 | |
| 106 | |
| 107 | def break_stale_lock(lock_file_path: Path) -> bool: |