MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / _cleanup_compute_lock

Method _cleanup_compute_lock

codeclash/viewer/app.py:155–162  ·  view source on GitHub ↗

Clean up compute lock after use to avoid memory leak

(self, key: str)

Source from the content-addressed store, hash-verified

153 return self._compute_locks[key]
154
155 def _cleanup_compute_lock(self, key: str):
156 """Clean up compute lock after use to avoid memory leak"""
157 with self._compute_locks_lock:
158 if key in self._compute_locks:
159 # Only delete if no one is using it (not locked)
160 lock = self._compute_locks[key]
161 if not lock.locked():
162 del self._compute_locks[key]
163
164 def get_or_compute(self, key: str, compute_fn, timeout_seconds: int | None = None) -> Any:
165 """Get cached value or compute it, preventing concurrent computation

Callers 1

get_or_computeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected