MCPcopy Create free account
hub / github.com/FastLED/FastLED / _check_stale_lock

Method _check_stale_lock

ci/compiler/lock_manager.py:45–63  ·  view source on GitHub ↗

Check if lock is stale (dead process) and remove if stale. Returns: True if lock was stale and removed, False otherwise

(self)

Source from the content-addressed store, hash-verified

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."""

Callers 1

acquireMethod · 0.95

Calls 4

is_lock_staleMethod · 0.80
break_stale_lockMethod · 0.80
printFunction · 0.50

Tested by

no test coverage detected