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 30310bf

Browse filesBrowse files
mfdebianmarco-ippolito
authored andcommitted
doc: move numCPUs require to top of file in cluster CJS example
PR-URL: #53932 Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent bd996bf commit 30310bf
Copy full SHA for 30310bf

1 file changed

+1-1Lines changed: 1 addition & 1 deletion

File tree

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

‎doc/api/cluster.md‎

Copy file name to clipboardExpand all lines: doc/api/cluster.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ if (cluster.isPrimary) {
317317
```cjs
318318
const cluster = require('node:cluster');
319319
const http = require('node:http');
320+
const numCPUs = require('node:os').availableParallelism();
320321
const process = require('node:process');
321322

322323
if (cluster.isPrimary) {
@@ -335,7 +336,6 @@ if (cluster.isPrimary) {
335336
}
336337

337338
// Start workers and listen for messages containing notifyRequest
338-
const numCPUs = require('node:os').availableParallelism();
339339
for (let i = 0; i < numCPUs; i++) {
340340
cluster.fork();
341341
}

0 commit comments

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