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

Method close

src/extraction/store-writer.ts:177–189  ·  view source on GitHub ↗

Close the worker's DB connection and join the thread.

()

Source from the content-addressed store, hash-verified

175
176 /** Close the worker's DB connection and join the thread. */
177 async close(): Promise<void> {
178 if (this.exited) return;
179 this.worker.postMessage({ type: 'close' });
180 await new Promise<void>((resolve) => {
181 const t = setTimeout(() => {
182 void this.worker.terminate().then(() => resolve());
183 }, 5000);
184 this.worker.once('exit', () => {
185 clearTimeout(t);
186 resolve();
187 });
188 });
189 }
190}

Callers

nothing calls this directly

Calls 3

postMessageMethod · 0.65
terminateMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected