From c1b2a6e2911f7d11c48074bb2811b3bbf193dac0 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sat, 7 Jul 2018 23:04:27 -0400 Subject: [PATCH] Try to keep old API --- lib/util/cluster-worker-id.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/util/cluster-worker-id.js b/lib/util/cluster-worker-id.js index c99086c..1022aa7 100644 --- a/lib/util/cluster-worker-id.js +++ b/lib/util/cluster-worker-id.js @@ -2,9 +2,5 @@ var cluster = require('cluster'); -/** -* NODE_UNIQUE_ID is not supported to identify an worker in cluster mode. -* @see https://github.com/ericjohn/node/blob/master/src/node.js#L83 -**/ -// module.exports = parseInt(process.env.NODE_UNIQUE_ID || 0, 10); -module.exports = parseInt(cluster.isMaster ? 0 : cluster.worker.id, 10); +var clusterId = cluster.isMaster ? 0 : cluster.worker.id; +module.exports = parseInt(process.env.NODE_UNIQUE_ID || clusterId, 10);