소스 검색

Fix node cluster for nodejs (#7506)

JaeHyeok Kim 3 년 전
부모
커밋
ae97b6a162
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      frameworks/JavaScript/nodejs/app.js

+ 4 - 4
frameworks/JavaScript/nodejs/app.js

@@ -13,16 +13,16 @@ if (process.env.TFB_TEST_NAME === 'nodejs-mongodb') {
   process.env.NODE_HANDLER = 'sequelize-postgres';
 }
 
-if (cluster.isMaster) {
+if (cluster.isPrimary) {
+  console.log(`Primary ${process.pid} is running`);
+
   // Fork workers.
   for (let i = 0; i < numCPUs; i++) {
     cluster.fork();
   }
 
   cluster.on('exit', (worker, code, signal) => {
-  	console.log([
-  	  'A process exit was triggered, most likely due to a failed database action',
-  	  'NodeJS test server shutting down now'].join('\n'));
+    console.log(`worker ${worker.process.pid} died`);
     process.exit(1);
   });
 } else {