Check if framework resolution is cached and still valid.
(self, framework_name: str)
| 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.""" |
| 1548 | if not hasattr(self, "_framework_cache"): |
| 1549 | self._framework_cache: dict[str, FrameworkResolution] = {} |
| 1550 | |
| 1551 | if framework_name not in self._framework_cache: |
| 1552 | return False |
| 1553 | |
| 1554 | resolution = self._framework_cache[framework_name] |
| 1555 | if not resolution.resolved_at: |
| 1556 | return False |
| 1557 | |
| 1558 | age = datetime.now() - resolution.resolved_at |
| 1559 | return age < timedelta(hours=resolution.ttl_hours) |
| 1560 | |
| 1561 | def _run_pio_command( |
| 1562 | self, args: list[str] |
no test coverage detected