From 14a2db4b2e58d9ba45a73435a91fac48549170c8 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 1 Dec 2014 14:45:32 -0500 Subject: [PATCH] fix workerIndex for ipv6 --- loader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader.js b/loader.js index 839aaecaa7..68d67db1e0 100644 --- a/loader.js +++ b/loader.js @@ -251,11 +251,11 @@ function forkWorker(isPrimary) { function workerIndex(ip, numProcs) { var s = ''; for (var i = 0, _len = ip.length; i < _len; i++) { - if (ip[i] !== '.') { + if (parseInt(ip[i], 10)) { s += ip[i]; } } - return Number(s) % numProcs; + return Number(s) % numProcs || 0; } function clusterWorkers() {