feat: graceful shutdown of server

This commit is contained in:
karishmas6
2024-10-07 01:40:13 +05:30
parent 5383576557
commit bba92f1030

View File

@@ -85,3 +85,9 @@ server.listen(SERVER_PORT, async () => {
await syncDB();
logger.log('info', `Server listening on port ${SERVER_PORT}`);
});
process.on('SIGINT', () => {
console.log('Main app shutting down...');
workerProcess.kill();
process.exit();
});