MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / settle

Function settle

sdk/src/tools/code-search.ts:125–142  ·  view source on GitHub ↗
(payload: any)

Source from the content-addressed store, hash-verified

123 let killTimeoutId: ReturnType<typeof setTimeout> | null = null
124
125 const settle = (payload: any) => {
126 if (isResolved) return
127 isResolved = true
128
129 // Clean up listeners immediately to prevent further events
130 childProcess.stdout.removeAllListeners()
131 childProcess.stderr.removeAllListeners()
132 childProcess.removeAllListeners()
133
134 // Clear both the main timeout and the kill timeout to prevent late callbacks
135 clearTimeout(timeoutId)
136 if (killTimeoutId) {
137 clearTimeout(killTimeoutId)
138 killTimeoutId = null
139 }
140
141 resolve([{ type: 'json', value: payload }])
142 }
143
144 const hardKill = () => {
145 try {

Callers 1

codeSearchFunction · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected