Skip to content

Commit

Permalink
Try to keep old API
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jul 8, 2018
1 parent 938466f commit c1b2a6e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/util/cluster-worker-id.js
Expand Up @@ -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);

0 comments on commit c1b2a6e

Please sign in to comment.