refactor(server): add shutdown idempotency guard and test teardown blocks
This commit is contained in:
1 parent
f1e84d281a
commit
3d4a064593
3 files changed
+45
-37
No files matched your search
@@ -12,7 +12,10 @@ async function main(): Promise<void> {
|
||||
const mcpServer = createServer(config);
|
||||
|
||||
// Bind graceful termination
|
||||
let isShuttingDown = false;
|
||||
const shutdown = async () => {
|
||||
if (isShuttingDown) return;
|
||||
isShuttingDown = true;
|
||||
console.error("\n[openproject-mcp] Received termination signal, shutting down...");
|
||||
await mcpServer.stop();
|
||||
process.exit(0);
|
||||
|
||||
Reference in new issue
Block a user