MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / shutdown

Function shutdown

src/index.ts:580–595  ·  view source on GitHub ↗
(reason: string, exitCode: number = 0)

Source from the content-addressed store, hash-verified

578 }
579 };
580 const shutdown = async (reason: string, exitCode: number = 0) => {
581 if (shuttingDown) return;
582 shuttingDown = true;
583 console.error(`Context+ MCP shutdown requested: ${reason}`);
584 await runCleanup({
585 cancelEmbeddings: cancelAllEmbeddings,
586 stopTracker: trackerController.stop,
587 closeServer,
588 closeTransport,
589 stopMonitors: () => {
590 idleMonitor.stop();
591 stopParentMonitor();
592 },
593 });
594 process.exit(exitCode);
595 };
596 const requestShutdown = (reason: string, exitCode: number = 0) => {
597 void shutdown(reason, exitCode);
598 };

Callers 1

requestShutdownFunction · 0.85

Calls 2

runCleanupFunction · 0.85
stopParentMonitorFunction · 0.85

Tested by

no test coverage detected