Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/everything/stdio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ async function main() {
const transport = new StdioServerTransport();
const {server, cleanup, startNotificationIntervals} = createServer();

// Cleanup when client disconnects
server.onclose = async () => {
await cleanup();
process.exit(0);
};

await server.connect(transport);
startNotificationIntervals();

// Cleanup on exit
process.on("SIGINT", async () => {
await cleanup();
await server.close();
process.exit(0);
await server.close();
});
}

Expand Down