MCPcopy Create free account
hub / github.com/SkyworkAI/DeepResearchAgent / get

Method get

src/environment/filesystem/cache.py:43–61  ·  view source on GitHub ↗

Get cached data with TTL check and access tracking.

(self, key: str)

Source from the content-addressed store, hash-verified

41 self._misses = 0
42
43 def get(self, key: str) -> Optional[bytes]:
44 """Get cached data with TTL check and access tracking."""
45 with self._lock:
46 entry = self._entries.get(key)
47 if not entry:
48 self._misses += 1
49 return None
50
51 # Check TTL
52 if time.time() - entry.timestamp > self._ttl_seconds:
53 self._delete_entry(key, entry)
54 self._misses += 1
55 return None
56
57 # Update access count and move to end (recently used)
58 entry.access_count += 1
59 self._entries.move_to_end(key)
60 self._hits += 1
61 return entry.data
62
63 def put(self, key: str, data: bytes) -> None:
64 """Put data in cache with size tracking."""

Callers 15

load_and_migrate_configFunction · 0.45
get_default_profileFunction · 0.45
get_default_llmFunction · 0.45
__init__.pyFile · 0.45
observability.pyFile · 0.45
input_textMethod · 0.45
get_dropdown_optionsMethod · 0.45
execute_jsMethod · 0.45

Calls 1

_delete_entryMethod · 0.95

Tested by

no test coverage detected