Skip to content

Commit 54ca0e1

Browse files
cjihrigtargos
authored andcommitted
cluster: move handle tracking out of utils
internal/cluster/utils.js exported a handles object, which was used in a test. That test, test-cluster-disconnect-handles.js, was removed in #12495. This commit moves the handles object to the only file in the codebase that still uses it. PR-URL: #23131 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 64689ed commit 54ca0e1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/internal/cluster/master.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const EventEmitter = require('events');
77
const RoundRobinHandle = require('internal/cluster/round_robin_handle');
88
const SharedHandle = require('internal/cluster/shared_handle');
99
const Worker = require('internal/cluster/worker');
10-
const { internal, sendHelper, handles } = require('internal/cluster/utils');
10+
const { internal, sendHelper } = require('internal/cluster/utils');
1111
const { ERR_SOCKET_BAD_PORT } = require('internal/errors').codes;
1212
const keys = Object.keys;
1313
const cluster = new EventEmitter();
@@ -19,6 +19,7 @@ const [ minPort, maxPort ] = [ 1024, 65535 ];
1919

2020
module.exports = cluster;
2121

22+
const handles = new Map();
2223
cluster.isWorker = false;
2324
cluster.isMaster = true;
2425
cluster.Worker = Worker;

lib/internal/cluster/utils.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ const util = require('util');
33

44
module.exports = {
55
sendHelper,
6-
internal,
7-
handles: new Map() // Used in tests.
6+
internal
87
};
98

109
const callbacks = new Map();

0 commit comments

Comments
 (0)