MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / _load_lock_data

Function _load_lock_data

astrbot/core/utils/desktop_core_lock.py:43–57  ·  view source on GitHub ↗
(lock_path: str)

Source from the content-addressed store, hash-verified

41
42@lru_cache(maxsize=8)
43def _load_lock_data(lock_path: str) -> dict[str, Any] | None:
44 try:
45 with open(lock_path, encoding="utf-8") as file:
46 data = json.load(file)
47 except FileNotFoundError:
48 logger.warning("桌面端核心依赖锁不存在: %s", lock_path)
49 return None
50 except Exception as exc:
51 logger.warning("读取桌面端核心依赖锁失败: %s", exc)
52 return None
53
54 if not isinstance(data, dict):
55 logger.warning("桌面端核心依赖锁格式无效: %s", lock_path)
56 return None
57 return data
58
59
60def _resolve_lock_data() -> dict[str, Any] | None:

Callers 1

_resolve_lock_dataFunction · 0.85

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected