diff --git a/lib/internal/cluster/child.js b/lib/internal/cluster/child.js index ab8eb7a44dd5dd..501fd6d739ad19 100644 --- a/lib/internal/cluster/child.js +++ b/lib/internal/cluster/child.js @@ -270,7 +270,7 @@ function _disconnect(primaryInitiated) { } } - for (const handle of handles) { + for (const handle of handles.values()) { waitingCount++; if (handle[owner_symbol]) diff --git a/lib/internal/cluster/primary.js b/lib/internal/cluster/primary.js index 6dd18ef658f85e..766e7838300d3b 100644 --- a/lib/internal/cluster/primary.js +++ b/lib/internal/cluster/primary.js @@ -153,7 +153,7 @@ function removeHandlesForWorker(worker) { assert(worker); // eslint-disable-next-line node-core/no-array-destructuring - for (const [key, handle] of handles.entries()) { + for (const [key, handle] of handles) { if (handle.remove(worker)) handles.delete(key); }