From eb07664e935e56bd744a11c752e6a05aae902035 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Wed, 10 Aug 2022 04:59:32 +0200 Subject: Make sigterm exit after 3 seconds to resolve hang under systemd --- bundle/src/Server.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'bundle/src/Server.ts') 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") }) -- cgit 1.5.1