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:
@@ -819,9 +819,10 @@ async function main() {
|
|||||||
services.cronServices.forEach(c => c.stop());
|
services.cronServices.forEach(c => c.stop());
|
||||||
services.pollingServices.forEach(p => p.stop());
|
services.pollingServices.forEach(p => p.stop());
|
||||||
await gateway.stop();
|
await gateway.stop();
|
||||||
|
apiServer.close();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
};
|
};
|
||||||
|
|
||||||
process.on('SIGINT', shutdown);
|
process.on('SIGINT', shutdown);
|
||||||
process.on('SIGTERM', shutdown);
|
process.on('SIGTERM', shutdown);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user