From 50051076d9e9d2dbbad62271f8574c7e3a5bca36 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 5 Aug 2022 00:06:31 -0400 Subject: [PATCH] Exit on SIGINT or SIGTERM --- src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/index.ts b/src/index.ts index 294c284..b2c9d26 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,3 +15,9 @@ boot(); process.on("uncaughtException", function (err) { console.log(`Caught exception: ${err.message} ${err.stack}`); }); +process.on("SIGINT", function () { + process.exit(); +}); +process.on("SIGTERM", function () { + process.exit(); +});