CLI: Do not exit(0) so each module can close its connections (#3634)
This commit is contained in:
@@ -84,9 +84,7 @@ function startServer(options, callback) {
|
|||||||
const handleShutdown = function() {
|
const handleShutdown = function() {
|
||||||
console.log('Termination signal received. Shutting down.');
|
console.log('Termination signal received. Shutting down.');
|
||||||
destroyAliveConnections();
|
destroyAliveConnections();
|
||||||
server.close(function () {
|
server.close();
|
||||||
process.exit(0);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
process.on('SIGTERM', handleShutdown);
|
process.on('SIGTERM', handleShutdown);
|
||||||
process.on('SIGINT', handleShutdown);
|
process.on('SIGINT', handleShutdown);
|
||||||
|
|||||||
Reference in New Issue
Block a user