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

Function startDaemon

__tests__/daemon-older-version.test.ts:514–526  ·  view source on GitHub ↗

A daemon process for the project, started the way a launcher starts one.

(env: NodeJS.ProcessEnv)

Source from the content-addressed store, hash-verified

512
513 /** A daemon process for the project, started the way a launcher starts one. */
514 function startDaemon(env: NodeJS.ProcessEnv): { child: ChildProcessWithoutNullStreams; log: string[] } {
515 const child = spawn(process.execPath, [...WASM_RUNTIME_FLAGS, BIN, 'serve', '--mcp', '--path', realRoot], {
516 cwd: tempDir,
517 stdio: ['pipe', 'pipe', 'pipe'],
518 env: { ...process.env, CODEGRAPH_DAEMON_INTERNAL: '1', CODEGRAPH_DAEMON_IDLE_TIMEOUT_MS: '30000', ...env },
519 }) as ChildProcessWithoutNullStreams;
520 child.on('error', () => { /* ignore */ });
521 child.stdout.resume();
522 const log: string[] = [];
523 lines(child.stderr, log);
524 daemonPids.add(child.pid!);
525 return { child, log };
526 }
527
528 /** The slot as a launcher that just stopped an older daemon holds it: this test process stands in. */
529 function holdWriterSlotForSuccessor(): string {

Callers 1

Calls 5

spawnFunction · 0.85
resumeMethod · 0.80
linesFunction · 0.70
onMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected