From 336d52637a50c30205d814849a200816b8eb178e Mon Sep 17 00:00:00 2001 From: Andy Gout Date: Thu, 23 May 2024 21:44:45 +0100 Subject: [PATCH] Run server.closeAllConnections() before server.close() --- src/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index 41a481c1..597b6033 100644 --- a/src/app.js +++ b/src/app.js @@ -29,7 +29,10 @@ const server = http.createServer(app); server.listen(port, () => console.log(`Listening on port ${port}`)); // eslint-disable-line no-console -const shutDown = () => server.close(() => neo4jDriver.close().then(() => process.exit(0))); +const shutDown = () => { + server.closeAllConnections(); + server.close(() => neo4jDriver.close().then(() => process.exit(0))); +}; process.on('SIGTERM', shutDown); process.on('SIGINT', shutDown);