MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / get_latest_version_cached

Function get_latest_version_cached

unity_cli/update_checker.py:20–31  ·  view source on GitHub ↗

Return cached latest version if TTL is still valid, else None.

()

Source from the content-addressed store, hash-verified

18
19
20def get_latest_version_cached() -> str | None:
21 """Return cached latest version if TTL is still valid, else None."""
22 try:
23 if not CACHE_FILE.exists():
24 return None
25 data = json.loads(CACHE_FILE.read_text())
26 if time.time() - data.get("checked_at", 0) > CHECK_INTERVAL:
27 return None
28 version: str | None = data.get("latest_version")
29 return version
30 except (json.JSONDecodeError, OSError):
31 return None
32
33
34def _fetch_latest_version() -> None:

Calls 1

getMethod · 0.45