mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 00:10:25 +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){
|
server.on("error", function(err){
|
||||||
if (err.code === 'EADDRINUSE') {
|
if (err.code === 'EADDRINUSE') {
|
||||||
winston.error('NodeBB address in use, exiting...');
|
winston.error('NodeBB address in use, exiting...');
|
||||||
process.exit(1);
|
if (cluster.isWorker) {
|
||||||
|
cluster.worker.kill();
|
||||||
|
} else {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user