Browse Source

Improve web-ui and js-executor microservices gracefull shutdown

pull/6904/head
Igor Kulikov 4 years ago
parent
commit
5f183f5f38
  1. 2
      msa/js-executor/server.ts
  2. 2
      msa/web-ui/server.ts

2
msa/js-executor/server.ts

@ -69,7 +69,7 @@ async function createQueue(serviceType: string): Promise<IQueue> {
} }
[`SIGINT`, `SIGUSR1`, `SIGUSR2`, `uncaughtException`, `SIGTERM`].forEach((eventType) => { [`SIGINT`, `SIGUSR1`, `SIGUSR2`, `uncaughtException`, `SIGTERM`].forEach((eventType) => {
process.on(eventType, async () => { process.once(eventType, async () => {
logger.info(`${eventType} signal received`); logger.info(`${eventType} signal received`);
await exit(0); await exit(0);
}) })

2
msa/web-ui/server.ts

@ -123,7 +123,7 @@ let connections: Socket[] = [];
})(); })();
[`SIGINT`, `SIGUSR1`, `SIGUSR2`, `uncaughtException`, `SIGTERM`].forEach((eventType) => { [`SIGINT`, `SIGUSR1`, `SIGUSR2`, `uncaughtException`, `SIGTERM`].forEach((eventType) => {
process.on(eventType, async () => { process.once(eventType, async () => {
logger.info(`${eventType} signal received`); logger.info(`${eventType} signal received`);
await exit(0); await exit(0);
}); });

Loading…
Cancel
Save