mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-17 04:32:53 -06:00
new_feature_sigterm
This commit is contained in:
parent
d70e538cbc
commit
98b245c7a3
@ -2,7 +2,7 @@ services:
|
|||||||
api:
|
api:
|
||||||
container_name: evolution_api_${ENVIROMNENT}
|
container_name: evolution_api_${ENVIROMNENT}
|
||||||
build: .
|
build: .
|
||||||
image: adaptweb/evolution-api:1.2.1
|
image: adaptweb/evolution-api:1.3.0
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
|
13
src/main.ts
13
src/main.ts
@ -145,6 +145,19 @@ async function bootstrap() {
|
|||||||
initWA();
|
initWA();
|
||||||
|
|
||||||
onUnexpectedError();
|
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();
|
bootstrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user