mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
better handling of port in use errors with cluster
This commit is contained in:
@@ -108,7 +108,11 @@ if(nconf.get('ssl')) {
|
||||
server.on("error", function(err){
|
||||
if (err.code === 'EADDRINUSE') {
|
||||
winston.error('NodeBB address in use, exiting...');
|
||||
process.exit(1);
|
||||
if (cluster.isWorker) {
|
||||
cluster.worker.kill();
|
||||
} else {
|
||||
process.exit(0);
|
||||
}
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user