Skip to content

Commit

Permalink
Run server.closeAllConnections() before server.close()
Browse files Browse the repository at this point in the history
  • Loading branch information
andygout committed May 23, 2024
1 parent a401b76 commit 336d526
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 336d526

Please sign in to comment.