From 49dcffcbab056ee1a2779f372b3806864e20c84c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 10 Dec 2014 18:52:38 -0500 Subject: [PATCH] if worker process exits with code zero, don't boot up a new worker --- loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader.js b/loader.js index 10b9916b34..4345624e4f 100644 --- a/loader.js +++ b/loader.js @@ -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);