chore: app shutdown way changed
This commit is contained in:
@@ -39,6 +39,6 @@ export function stopApp() {
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('Stopping app now...');
|
||||
process.exit();
|
||||
process.kill(process.pid, 'SIGTERM');
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user