From bce96d04c720eafc1ca2fac1cbc42aeac4a28842 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 28 Oct 2014 16:33:14 -0400 Subject: [PATCH] forkWorker function, pipe new worker output to log --- loader.js | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/loader.js b/loader.js index c95a4e462f..81be2fb572 100644 --- a/loader.js +++ b/loader.js @@ -166,9 +166,7 @@ Loader.addClusterEvents = function(callback) { console.log('[cluster] Spinning up another process...'); var wasPrimary = parseInt(worker.id, 10) === Loader.primaryWorker; - cluster.fork({ - handle_jobs: wasPrimary - }); + forkWorker(wasPrimary); } }); @@ -177,31 +175,32 @@ Loader.addClusterEvents = function(callback) { }); callback(); -} +}; Loader.start = function(callback) { - var output = logrotate({ file: __dirname + '/logs/output.log', size: '1m', keep: 3, compress: true }), - worker; - console.log('Clustering enabled: Spinning up ' + numProcs + ' process(es).\n'); - for(var x=0;x