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

Method _check_stale_lock

ci/compiler/lock_manager.py:189–209  ·  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

187 self.is_locked = False
188
189 def _check_stale_lock(self) -> bool:
190 """Check if lock is stale (dead process) and remove if stale.
191
192 Returns:
193 True if lock was stale and removed, False otherwise
194 """
195 try:
196 if self._db.is_lock_stale(self._lock_name):
197 print(
198 f"Detected stale platform lock at {self.lock_file_path}. Removing..."
199 )
200 if self._db.break_stale_lock(self._lock_name):
201 print(f"Removed stale lock file: {self.lock_file_path}")
202 return True
203 return False
204 except KeyboardInterrupt as ki:
205 handle_keyboard_interrupt(ki)
206 raise
207 except Exception as e:
208 print(f"Warning: Could not check for stale lock: {e}")
209 return False
210
211 def acquire(self) -> None:
212 """Acquire the platform lock."""

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