diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-08-10 04:59:32 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-08-10 04:59:32 +0200 |
commit | eb07664e935e56bd744a11c752e6a05aae902035 (patch) | |
tree | 4d7427ee95844b72cab8c60655f606f5f4355e7d | |
parent | Fix heartbeat not accepting d == null (diff) | |
download | server-eb07664e935e56bd744a11c752e6a05aae902035.tar.xz |
Make sigterm exit after 3 seconds to resolve hang under systemd
-rw-r--r-- | bundle/src/Server.ts | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bundle/src/Server.ts b/bundle/src/Server.ts index 81948666..3ed98b15 100644 --- a/bundle/src/Server.ts +++ b/bundle/src/Server.ts @@ -26,6 +26,7 @@ const gateway = new Gateway.Server({ server, port, production }); //this is what has been added for the /stop API route process.on('SIGTERM', () => { + setTimeout(()=>process.exit(0), 3000) server.close(() => { console.log("Stop API has been successfully POSTed, SIGTERM sent") }) |