if worker process exits with code zero, don't boot up a new worker

This commit is contained in:
Julian Lam
2014-12-10 18:52:38 -05:00
parent 68e761bed0
commit 49dcffcbab

View File

@@ -71,7 +71,7 @@ Loader.addWorkerEvents = function(worker) {
}
console.log('[cluster] Child Process (' + worker.pid + ') has exited (code: ' + code + ', signal: ' + signal +')');
if (!worker.suicide) {
if (!(worker.suicide || code === 0)) {
console.log('[cluster] Spinning up another process...');
forkWorker(worker.index, worker.isPrimary);