MCPcopy Create free account
hub / github.com/SunOner/sunone_aimbot / _write_system_status_cache

Function _write_system_status_cache

helper_api.py:781–801  ·  view source on GitHub ↗
(status: dict[str, Any], expires_at: float)

Source from the content-addressed store, hash-verified

779
780
781def _write_system_status_cache(status: dict[str, Any], expires_at: float) -> None:
782 temp_path: Path | None = None
783 try:
784 with tempfile.NamedTemporaryFile(
785 delete=False,
786 dir=PROJECT_DIR,
787 encoding="utf-8",
788 mode="w",
789 suffix=".meta-cache.json",
790 ) as file:
791 json.dump({"expires_at": expires_at, "status": status}, file)
792 temp_path = Path(file.name)
793 os.replace(temp_path, SYSTEM_META_CACHE_PATH)
794 except OSError:
795 pass
796 finally:
797 if temp_path and temp_path.exists():
798 try:
799 temp_path.unlink()
800 except OSError:
801 pass
802
803
804def _cached_status(force: bool = False) -> dict[str, Any]:

Callers 1

_cached_statusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected