Skip to content

Commit 814cdaf

Browse files
JHyeokfranz1981
authored andcommitted
Revert "Fix use the physical CPU count from NestJS (TechEmpower#7987)" (TechEmpower#8045)
This reverts commit e0fa211.
1 parent 3ae581c commit 814cdaf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

frameworks/TypeScript/nest/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"mongodb": "3.5.4",
2929
"mysql2": "2.1.0",
3030
"pg": "8.5.1",
31-
"physical-cpu-count": "^2.0.0",
3231
"point-of-view": "3.7.2",
3332
"reflect-metadata": "0.1.13",
3433
"rimraf": "3.0.2",

frameworks/TypeScript/nest/src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { MongoModule } from './mongo/mongo.module';
99
import { join } from 'path';
1010
import { SqlModule } from './sql/sql.module';
1111
import cluster from 'cluster'
12-
import physicalCpuCount from 'physical-cpu-count';
12+
import os = require('os');
1313

1414
const port = process.env.PORT || 8080;
1515

@@ -58,7 +58,8 @@ async function bootstrapFastify() {
5858
}
5959

6060
if (cluster.isPrimary) {
61-
for (let i = 0; i < physicalCpuCount; i++) {
61+
const cpus = os.cpus().length;
62+
for (let i = 0; i < cpus; i++) {
6263
cluster.fork();
6364
}
6465

0 commit comments

Comments
 (0)