mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 10:56:27 +00:00
disabled cluster
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
require('dotenv').config();
|
||||
const cluster = require('node:cluster');
|
||||
const totalCPUs = require('node:os').cpus().length;
|
||||
// const cluster = require('node:cluster');
|
||||
// const totalCPUs = require('node:os').cpus().length;
|
||||
const process = require('node:process');
|
||||
const winston = require('./application/helpers/winston.logger');
|
||||
const server = require('./server');
|
||||
@@ -29,6 +29,8 @@ if (process.env.CHANGE_TO_DRC == 'YES' || process.env.CHANGE_TO_DRC == 'yes') {
|
||||
}
|
||||
}
|
||||
|
||||
// jika mau di cluster gunakan script berikut:
|
||||
|
||||
// if (cluster.isMaster) {
|
||||
// console.log(`Number of CPUs is ${totalCPUs}`);
|
||||
// console.log(`Master ${process.pid} is running`);
|
||||
@@ -44,11 +46,14 @@ if (process.env.CHANGE_TO_DRC == 'YES' || process.env.CHANGE_TO_DRC == 'yes') {
|
||||
// cluster.fork();
|
||||
// });
|
||||
// } else {
|
||||
startExpress();
|
||||
// startExpress();
|
||||
// }
|
||||
|
||||
// console.log(`worker pid=${process.pid}`);
|
||||
|
||||
// jika tidak mau di cluster langsung call function startExpress
|
||||
startExpress();
|
||||
|
||||
function startExpress() {
|
||||
server.listen(PORT, () => {
|
||||
winston.logger.info(
|
||||
|
||||
Reference in New Issue
Block a user