Skip to content

Commit 73e4be6

Browse files
authored
Merge pull request #8 from SaranshBS/main
keeping code dir dynamic for cluster
2 parents d5fb569 + 851e90d commit 73e4be6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cluster.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
'use strict';
22

33
const cluster = require('cluster');
4-
const { config } = require('./lib/config/constants.js');
54
const { watch } = require('fs');
6-
const logger = require('./lib/util/loggerFactory.js');
7-
const Proxy = require('./lib/core/Proxy.js');
5+
const path = require('path');
6+
7+
const codeDir = process.env.CODE_DIR || path.join(__dirname, '/');
8+
const { config } = require(path.join(codeDir, 'lib/config/constants.js'));
9+
const logger = require(path.join(codeDir, 'lib/util/loggerFactory.js'));
10+
const Proxy = require(path.join(codeDir, 'lib/core/Proxy.js'));
811

912
const WORKER_CNT = config.workerVal;
1013
const activeWorkers = [];
1114

12-
const path = require('path');
13-
14-
const RESTART_FILE = path.join(__dirname, 'tmp', 'restart.txt');
15+
const RESTART_FILE = path.join(codeDir, 'tmp/restart.txt');
1516

1617
const forceKill = (worker) => {
1718
if (!worker.isDead()) {

0 commit comments

Comments
 (0)