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

Method _is_platform_cached

ci/compiler/platformio_ini.py:1531–1544  ·  view source on GitHub ↗

Check if platform resolution is cached and still valid.

(self, platform_name: str)

Source from the content-addressed store, hash-verified

1529 return packages
1530
1531 def _is_platform_cached(self, platform_name: str) -> bool:
1532 """Check if platform resolution is cached and still valid."""
1533 if not hasattr(self, "_platform_cache"):
1534 self._platform_cache: dict[str, PlatformResolution] = {}
1535
1536 if platform_name not in self._platform_cache:
1537 return False
1538
1539 resolution = self._platform_cache[platform_name]
1540 if not resolution.resolved_at:
1541 return False
1542
1543 age = datetime.now() - resolution.resolved_at
1544 return age < timedelta(hours=resolution.ttl_hours)
1545
1546 def _is_framework_cached(self, framework_name: str) -> bool:
1547 """Check if framework resolution is cached and still valid."""

Calls 1

nowMethod · 0.45

Tested by 2

test_cache_expirationMethod · 0.64