diff --git a/msa/js-executor/server.ts b/msa/js-executor/server.ts index 446f9d34aa..035bf77183 100644 --- a/msa/js-executor/server.ts +++ b/msa/js-executor/server.ts @@ -69,7 +69,7 @@ async function createQueue(serviceType: string): Promise { } [`SIGINT`, `SIGUSR1`, `SIGUSR2`, `uncaughtException`, `SIGTERM`].forEach((eventType) => { - process.on(eventType, async () => { + process.once(eventType, async () => { logger.info(`${eventType} signal received`); await exit(0); }) diff --git a/msa/web-ui/server.ts b/msa/web-ui/server.ts index 2aafe879d1..5ba56add1a 100644 --- a/msa/web-ui/server.ts +++ b/msa/web-ui/server.ts @@ -123,7 +123,7 @@ let connections: Socket[] = []; })(); [`SIGINT`, `SIGUSR1`, `SIGUSR2`, `uncaughtException`, `SIGTERM`].forEach((eventType) => { - process.on(eventType, async () => { + process.once(eventType, async () => { logger.info(`${eventType} signal received`); await exit(0); });