Check if lock is stale (dead process) and remove if stale. Returns: True if lock was stale and removed, False otherwise
(self)
| 43 | self._is_acquired = False |
| 44 | |
| 45 | def _check_stale_lock(self) -> bool: |
| 46 | """Check if lock is stale (dead process) and remove if stale. |
| 47 | |
| 48 | Returns: |
| 49 | True if lock was stale and removed, False otherwise |
| 50 | """ |
| 51 | try: |
| 52 | if self._db.is_lock_stale(self._lock_name): |
| 53 | print(f"Detected stale lock for {self.platform_name}. Removing...") |
| 54 | if self._db.break_stale_lock(self._lock_name): |
| 55 | print(f"Removed stale lock for {self.platform_name}") |
| 56 | return True |
| 57 | return False |
| 58 | except KeyboardInterrupt as ki: |
| 59 | handle_keyboard_interrupt(ki) |
| 60 | raise |
| 61 | except Exception as e: |
| 62 | print(f"Warning: Could not check for stale lock: {e}") |
| 63 | return False |
| 64 | |
| 65 | def acquire(self) -> None: |
| 66 | """Acquire the global package installation lock for this board.""" |
no test coverage detected