Container for lock metadata information.
| 23 | |
| 24 | @dataclass |
| 25 | class LockInfo: |
| 26 | """Container for lock metadata information.""" |
| 27 | |
| 28 | path: str |
| 29 | pid: int | None |
| 30 | operation: str |
| 31 | timestamp: str | None |
| 32 | is_stale: bool |
| 33 | hostname: str | None |
| 34 | |
| 35 | def __str__(self) -> str: |
| 36 | """Human-readable lock information.""" |
| 37 | status = "STALE" if self.is_stale else "ACTIVE" |
| 38 | pid_str = f"PID {self.pid}" if self.pid else "unknown PID" |
| 39 | return f"{status}: {self.path} ({pid_str}, {self.operation})" |
| 40 | |
| 41 | |
| 42 | def acquire_artifact_lock( |