Selaa lähdekoodia

Revert "Fix use the physical CPU count from Fastify (#7988)" (#8044)

This reverts commit fe2ff266378f97e5e2dd76992438af6307043973.
JaeHyeok Kim 2 vuotta sitten
vanhempi
commit
d9be4ee3be

+ 2 - 2
frameworks/JavaScript/fastify/app.js

@@ -1,11 +1,11 @@
 const cluster = require("cluster");
-const physicalCpuCount = require("physical-cpu-count")
+const numCPUs = require("os").cpus().length;
 
 if (cluster.isPrimary) {
   console.log(`Primary ${process.pid} is running`);
 
   // Fork workers.
-  for (let i = 0; i < physicalCpuCount; i++) {
+  for (let i = 0; i < numCPUs; i++) {
     cluster.fork();
   }
 

+ 1 - 1
frameworks/JavaScript/fastify/fastify-mysql.dockerfile

@@ -1,4 +1,4 @@
-FROM node:18.12.1-slim
+FROM node:18.12.1-alpine
 
 COPY ./ ./
 

+ 1 - 1
frameworks/JavaScript/fastify/fastify-postgres.dockerfile

@@ -1,4 +1,4 @@
-FROM node:18.12.1-slim
+FROM node:18.12.1-alpine
 
 COPY ./ ./
 

+ 1 - 1
frameworks/JavaScript/fastify/fastify.dockerfile

@@ -1,4 +1,4 @@
-FROM node:18.12.1-slim
+FROM node:18.12.1-alpine
 
 COPY ./ ./
 

+ 1 - 2
frameworks/JavaScript/fastify/package.json

@@ -11,7 +11,6 @@
     "knex": "2.4.2",
     "mongodb": "3.5.9",
     "mysql2": "2.2.5",
-    "pg": "8.5.1",
-    "physical-cpu-count": "^2.0.0"
+    "pg": "8.5.1"
   }
 }