mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 12:12:55 -06:00
new_feature_sigterm
This commit is contained in:
parent
d70e538cbc
commit
98b245c7a3
@ -2,7 +2,7 @@ services:
|
||||
api:
|
||||
container_name: evolution_api_${ENVIROMNENT}
|
||||
build: .
|
||||
image: adaptweb/evolution-api:1.2.1
|
||||
image: adaptweb/evolution-api:1.3.0
|
||||
restart: always
|
||||
depends_on:
|
||||
- redis
|
||||
|
13
src/main.ts
13
src/main.ts
@ -145,6 +145,19 @@ async function bootstrap() {
|
||||
initWA();
|
||||
|
||||
onUnexpectedError();
|
||||
|
||||
process.on('SIGTERM', () => {
|
||||
logger.warn('SIGTERM received, shutting down...');
|
||||
server.close(() => {
|
||||
logger.info('Server closed, exiting...');
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
logger.error('Could not close connections in time, forcefully exiting');
|
||||
process.exit(1);
|
||||
}, 30000);
|
||||
});
|
||||
}
|
||||
|
||||
bootstrap();
|
||||
|
Loading…
Reference in New Issue
Block a user