Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a4ff2ac

Browse filesBrowse files
ehsankhfrmarco-ippolito
authored andcommitted
lib: improve cluster/primary code
PR-URL: #53756 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 993bb3b commit a4ff2ac
Copy full SHA for a4ff2ac

1 file changed

+3-5Lines changed: 3 additions & 5 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/cluster/primary.js‎

Copy file name to clipboardExpand all lines: lib/internal/cluster/primary.js
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ function emitForkNT(worker) {
221221
}
222222

223223
cluster.disconnect = function(cb) {
224-
const workers = ObjectKeys(cluster.workers);
224+
const workers = ObjectValues(cluster.workers);
225225

226226
if (workers.length === 0) {
227227
process.nextTick(() => intercom.emit('disconnect'));
228228
} else {
229-
for (const worker of ObjectValues(cluster.workers)) {
229+
for (const worker of workers) {
230230
if (worker.isConnected()) {
231231
worker.disconnect();
232232
}
@@ -358,8 +358,6 @@ Worker.prototype.disconnect = function() {
358358
};
359359

360360
Worker.prototype.destroy = function(signo) {
361-
const proc = this.process;
362361
const signal = signo || 'SIGTERM';
363-
364-
proc.kill(signal);
362+
this.process.kill(signal);
365363
};

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.