(lock_path: str)
| 41 | |
| 42 | @lru_cache(maxsize=8) |
| 43 | def _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 | |
| 60 | def _resolve_lock_data() -> dict[str, Any] | None: |
no test coverage detected