From 54ca0e159f719f15866e665edfd79052ad59c8ef Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 27 Sep 2018 14:12:39 -0400 Subject: [PATCH] cluster: move handle tracking out of utils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit internal/cluster/utils.js exported a handles object, which was used in a test. That test, test-cluster-disconnect-handles.js, was removed in https://github.com/nodejs/node/pull/12495. This commit moves the handles object to the only file in the codebase that still uses it. PR-URL: https://github.com/nodejs/node/pull/23131 Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Anna Henningsen Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- lib/internal/cluster/master.js | 3 ++- lib/internal/cluster/utils.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/cluster/master.js b/lib/internal/cluster/master.js index 2eead0b8a3a70a..60083c6393e781 100644 --- a/lib/internal/cluster/master.js +++ b/lib/internal/cluster/master.js @@ -7,7 +7,7 @@ const EventEmitter = require('events'); const RoundRobinHandle = require('internal/cluster/round_robin_handle'); const SharedHandle = require('internal/cluster/shared_handle'); const Worker = require('internal/cluster/worker'); -const { internal, sendHelper, handles } = require('internal/cluster/utils'); +const { internal, sendHelper } = require('internal/cluster/utils'); const { ERR_SOCKET_BAD_PORT } = require('internal/errors').codes; const keys = Object.keys; const cluster = new EventEmitter(); @@ -19,6 +19,7 @@ const [ minPort, maxPort ] = [ 1024, 65535 ]; module.exports = cluster; +const handles = new Map(); cluster.isWorker = false; cluster.isMaster = true; cluster.Worker = Worker; diff --git a/lib/internal/cluster/utils.js b/lib/internal/cluster/utils.js index c3e14cbb53a721..3fc5e408b76a5a 100644 --- a/lib/internal/cluster/utils.js +++ b/lib/internal/cluster/utils.js @@ -3,8 +3,7 @@ const util = require('util'); module.exports = { sendHelper, - internal, - handles: new Map() // Used in tests. + internal }; const callbacks = new Map();