Determine whether the cached value can be reused.
(force_refresh: bool)
| 51 | |
| 52 | |
| 53 | def _should_use_cache(force_refresh: bool) -> bool: |
| 54 | """Determine whether the cached value can be reused.""" |
| 55 | if force_refresh: |
| 56 | return False |
| 57 | if not _cached_version: |
| 58 | return False |
| 59 | if _cached_at <= 0: |
| 60 | return False |
| 61 | return (time.time() - _cached_at) < CACHE_TTL_SECONDS |
| 62 | |
| 63 | |
| 64 | def get_latest_fe_version(force_refresh: bool = False) -> str: |
no outgoing calls
no test coverage detected