Skip to content

Commit d395ee6

Browse files
committed
fixes
1 parent a61d4d5 commit d395ee6

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

js/botasaurus-js/src/env.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,18 @@ const isGitpodEnvironment: boolean = 'GITPOD_WORKSPACE_ID' in process.env;
2929

3030
const isVmish: boolean = isDocker || isVm || isGitpodEnvironment;
3131

32-
const isWorker: boolean = isInKubernetes && process.env.NODE_TYPE === "WORKER";
33-
const isMaster: boolean = isInKubernetes && process.env.NODE_TYPE === "MASTER";
32+
function _isMaster() {
33+
const args = process.argv;
34+
return args.includes('--master')
35+
}
36+
37+
function _isWorker() {
38+
const args = process.argv;
39+
return args.includes('--worker')
40+
}
41+
42+
const isWorker: boolean = _isWorker();
43+
const isMaster: boolean = _isMaster();
3444

3545
const IS_VM_OR_DOCKER = isDocker || isVm;
3646
const IS_PRODUCTION = process.env.ENV === "production";

js/botasaurus-server-js/src/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ const isMaster: boolean = _isMaster();
1515
const isDev: boolean =
1616
process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === 'true';
1717

18-
export { isInKubernetes, isWorker, isMaster, isDev };
18+
export { isInKubernetes, isWorker, isMaster, isDev };

0 commit comments

Comments
 (0)