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

Function cleanupStateIndex

packages/opencode/src/mcp/oauth-callback.ts:26–33  ·  view source on GitHub ↗
(oauthState: string)

Source from the content-addressed store, hash-verified

24const CALLBACK_TIMEOUT_MS = 5 * 60 * 1000 // 5 minutes
25
26function cleanupStateIndex(oauthState: string) {
27 for (const [name, state] of mcpNameToState) {
28 if (state === oauthState) {
29 mcpNameToState.delete(name)
30 break
31 }
32 }
33}
34
35function stopIfIdle() {
36 if (pendingAuths.size > 0 || !server) return

Callers 1

handleRequestFunction · 0.85

Calls 1

deleteMethod · 0.45

Tested by

no test coverage detected