MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / stop

Method stop

src/mcp/engine.ts:203–218  ·  view source on GitHub ↗

* Close everything. Used on graceful daemon shutdown (SIGTERM/idle timeout) * and on direct-mode stop. Idempotent.

()

Source from the content-addressed store, hash-verified

201 * and on direct-mode stop. Idempotent.
202 */
203 stop(): void {
204 if (this.closed) return;
205 this.closed = true;
206 // Detach + terminate the worker pool first so no tool call routes to a
207 // worker mid-teardown; outstanding pool calls resolve with graceful guidance.
208 this.toolHandler.setQueryPool(null);
209 if (this.queryPool) {
210 void this.queryPool.destroy();
211 this.queryPool = null;
212 }
213 this.toolHandler.closeAll();
214 if (this.cg) {
215 try { this.cg.close(); } catch { /* ignore */ }
216 this.cg = null;
217 }
218 }
219
220 private async doInitialize(searchFrom: string): Promise<void> {
221 this.toolHandler.setDefaultProjectHint(searchFrom);

Callers

nothing calls this directly

Calls 4

setQueryPoolMethod · 0.80
closeAllMethod · 0.80
closeMethod · 0.65
destroyMethod · 0.45

Tested by

no test coverage detected