MCPcopy Create free account
hub / github.com/anomalyco/opencode / prune

Function prune

packages/opencode/src/plugin/openai/ws-pool.ts:169–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167 }
168
169 function prune() {
170 const now = Date.now()
171 for (const [key, entry] of pool) {
172 if (entry.busy) continue
173 if (entry.fallback) continue
174 if (now - entry.lastUsedAt < idleTimeout) continue
175 invalidate(entry)
176 pool.delete(key)
177 }
178 }
179
180 function close() {
181 clearInterval(pruneTimer)

Callers 2

createWebSocketFetchFunction · 0.70
index.tsFile · 0.50

Calls 2

invalidateFunction · 0.70
deleteMethod · 0.45

Tested by

no test coverage detected