chore: app shutdown way changed

This commit is contained in:
Mir Arif Hasan
2023-12-12 12:38:07 +06:00
parent 99d369fc79
commit eec5b8f9c8
2 changed files with 7 additions and 1 deletions

View File

@@ -39,6 +39,6 @@ export function stopApp() {
setTimeout(() => {
console.log('Stopping app now...');
process.exit();
process.kill(process.pid, 'SIGTERM');
}, 5000);
}

View File

@@ -53,6 +53,12 @@ async function bootstrap() {
});
app.use(cookieParser());
await app.listen(configService.get('PORT') || 3170);
// Graceful shutdown
process.on('SIGTERM', async () => {
console.info('SIGTERM signal received');
await app.close();
});
}
if (!process.env.GENERATE_GQL_SCHEMA) {