(reason: string, exitCode: number = 0)
| 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 | }; |
no test coverage detected