MCPcopy Index your code
hub / github.com/CodeClash-ai/CodeClash / get

Method get

codeclash/viewer/app.py:115–130  ·  view source on GitHub ↗

Get cached value if it exists and hasn't expired

(self, key: str, timeout_seconds: int | None = None)

Source from the content-addressed store, hash-verified

113 self._compute_locks_lock = threading.Lock()
114
115 def get(self, key: str, timeout_seconds: int | None = None) -> Any | None:
116 """Get cached value if it exists and hasn't expired"""
117 with self._cache_lock:
118 if key not in self._cache:
119 return None
120
121 entry = self._cache[key]
122
123 # Check if cache is still valid
124 if timeout_seconds is not None:
125 age = (datetime.now() - entry.timestamp).total_seconds()
126 if age > timeout_seconds:
127 del self._cache[key]
128 return None
129
130 return entry.data
131
132 def set(self, key: str, value: Any):
133 """Set cache value"""

Callers 15

get_or_computeMethod · 0.95
update_agent_infoFunction · 0.80
test_default_argsMethod · 0.80
test_default_argsMethod · 0.80
formatMethod · 0.80
assert_zero_exit_codeFunction · 0.80
get_arenaFunction · 0.80
to_dictMethod · 0.80
parseMethod · 0.80
name_forMethod · 0.80
__init__Method · 0.80

Calls

no outgoing calls

Tested by 2

test_default_argsMethod · 0.64
test_default_argsMethod · 0.64