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

Function _read_lock_metadata

ci/util/file_lock_rw.py:59–81  ·  view source on GitHub ↗

Read metadata from lock database for backward compatibility. Args: lock_file_path: Path to the lock file Returns: Dictionary with metadata, or None if no lock is held

(lock_file_path: Path)

Source from the content-addressed store, hash-verified

57
58
59def _read_lock_metadata(lock_file_path: Path) -> dict[str, Any] | None:
60 """Read metadata from lock database for backward compatibility.
61
62 Args:
63 lock_file_path: Path to the lock file
64
65 Returns:
66 Dictionary with metadata, or None if no lock is held
67 """
68 db = get_lock_database(lock_file_path)
69 lock_name = str(lock_file_path)
70 holders = db.get_lock_info(lock_name)
71 if not holders:
72 return None
73
74 # Return first holder's info in the legacy format
75 holder = holders[0]
76 return {
77 "pid": holder["owner_pid"],
78 "timestamp": str(holder["acquired_at"]),
79 "operation": holder["operation"],
80 "hostname": holder["hostname"],
81 }
82
83
84def _remove_lock_metadata(lock_file_path: Path) -> None:

Calls 2

get_lock_databaseFunction · 0.90
get_lock_infoMethod · 0.80