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

Class CacheEntry

relay/request_cache.py:21–28  ·  view source on GitHub ↗

A cached response entry

Source from the content-addressed store, hash-verified

19
20@dataclass
21class 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
31class RequestCache:

Callers 9

test_is_expired_falseMethod · 0.90
test_is_expired_trueMethod · 0.90
test_clearMethod · 0.90
test_sizeMethod · 0.90
test_cleanup_expiredMethod · 0.90
handle_requestMethod · 0.85

Calls

no outgoing calls

Tested by 8

test_is_expired_falseMethod · 0.72
test_is_expired_trueMethod · 0.72
test_clearMethod · 0.72
test_sizeMethod · 0.72
test_cleanup_expiredMethod · 0.72