fix: close API server on shutdown to prevent EADDRINUSE (#477)

Co-authored-by: Dustin Doan <dustin@myhealthspan.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
dustindoan
2026-03-04 11:40:58 -08:00
committed by GitHub
parent 87aaa779bf
commit 587621d9e4

View File

@@ -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);
}