From 587621d9e4e5ce52cea68590a776fae0b35c26ad Mon Sep 17 00:00:00 2001 From: dustindoan Date: Wed, 4 Mar 2026 11:40:58 -0800 Subject: [PATCH] fix: close API server on shutdown to prevent EADDRINUSE (#477) Co-authored-by: Dustin Doan Co-authored-by: Claude Opus 4.6 --- src/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 07fb83f..21aa84a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -819,9 +819,10 @@ async function main() { services.cronServices.forEach(c => c.stop()); services.pollingServices.forEach(p => p.stop()); await gateway.stop(); + apiServer.close(); process.exit(0); }; - + process.on('SIGINT', shutdown); process.on('SIGTERM', shutdown); }