CLI: Do not exit(0) so each module can close its connections (#3634)

This commit is contained in:
Florent Vilmart
2017-03-13 12:13:07 -04:00
committed by GitHub
parent 80ec61f7ce
commit eb1b84b556

View File

@@ -84,9 +84,7 @@ function startServer(options, callback) {
const handleShutdown = function() {
console.log('Termination signal received. Shutting down.');
destroyAliveConnections();
server.close(function () {
process.exit(0);
});
server.close();
};
process.on('SIGTERM', handleShutdown);
process.on('SIGINT', handleShutdown);