A cached response entry
| 19 | |
| 20 | @dataclass |
| 21 | class CacheEntry: |
| 22 | """A cached response entry""" |
| 23 | |
| 24 | response: dict[str, Any] |
| 25 | created_at: float = field(default_factory=time.time) |
| 26 | |
| 27 | def is_expired(self, ttl_seconds: float) -> bool: |
| 28 | return time.time() - self.created_at > ttl_seconds |
| 29 | |
| 30 | |
| 31 | class RequestCache: |
no outgoing calls