MCPcopy
hub / github.com/colbymchenry/codegraph / stop

Method stop

src/mcp/engine.ts:184–199  ·  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

182 * and on direct-mode stop. Idempotent.
183 */
184 stop(): void {
185 if (this.closed) return;
186 this.closed = true;
187 // Detach + terminate the worker pool first so no tool call routes to a
188 // worker mid-teardown; outstanding pool calls resolve with graceful guidance.
189 this.toolHandler.setQueryPool(null);
190 if (this.queryPool) {
191 void this.queryPool.destroy();
192 this.queryPool = null;
193 }
194 this.toolHandler.closeAll();
195 if (this.cg) {
196 try { this.cg.close(); } catch { /* ignore */ }
197 this.cg = null;
198 }
199 }
200
201 private async doInitialize(searchFrom: string): Promise<void> {
202 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