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

Method list_all_locks

ci/util/lock_database.py:332–358  ·  view source on GitHub ↗

List all lock records. Returns: List of dicts with all lock holder information

(self)

Source from the content-addressed store, hash-verified

330 conn.close()
331
332 def list_all_locks(self) -> list[dict[str, Any]]:
333 """List all lock records.
334
335 Returns:
336 List of dicts with all lock holder information
337 """
338 conn = self._get_connection()
339 try:
340 cursor = conn.cursor()
341 cursor.execute(
342 "SELECT lock_name, owner_pid, lock_mode, operation, hostname, acquired_at "
343 "FROM lock_holders ORDER BY lock_name, acquired_at"
344 )
345 rows = cursor.fetchall()
346 return [
347 {
348 "lock_name": r[0],
349 "owner_pid": r[1],
350 "lock_mode": r[2],
351 "operation": r[3],
352 "hostname": r[4],
353 "acquired_at": r[5],
354 }
355 for r in rows
356 ]
357 finally:
358 conn.close()
359
360 def cleanup_stale_locks(self) -> int:
361 """Remove all lock rows where owner PID is dead.

Callers 6

cleanup_stale_locksMethod · 0.95
test_list_all_locksMethod · 0.80
force_unlock_cacheFunction · 0.80
list_active_locksFunction · 0.80
list_locksFunction · 0.80

Calls 3

_get_connectionMethod · 0.95
executeMethod · 0.80
closeMethod · 0.45

Tested by 2

test_list_all_locksMethod · 0.64