Skip to content

Commit 217cc06

Browse files
committed
fix: pm2_env will nerver use in runtime judge
Refs: #25
1 parent aba8e22 commit 217cc06

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

get_process_env.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ function getProcessEnv(pid) {
4444
});
4545
const lines = output.split('\u0000');
4646

47-
var env = {ENABLE_NODE_LOG: '', NODE_LOG_DIR: '/tmp'};
48-
var pm2_env = {};
47+
var env = { ENABLE_NODE_LOG: '', NODE_LOG_DIR: '/tmp' };
4948

5049
for (var i = 0; i < lines.length; i++) {
5150
const line = lines[i];
@@ -56,18 +55,8 @@ function getProcessEnv(pid) {
5655
if (line.startsWith('NODE_LOG_DIR')) {
5756
env.NODE_LOG_DIR = line.split('=')[1];
5857
}
59-
60-
if (line.startsWith('pm2_env=')) {
61-
try {
62-
pm2_env = JSON.parse(line.substr('pm2_env='.length));
63-
} catch (e) {
64-
}
65-
}
6658
}
6759

68-
env.NODE_LOG_DIR = env.NODE_LOG_DIR || pm2_env.NODE_LOG_DIR;
69-
env.ENABLE_NODE_LOG = env.ENABLE_NODE_LOG || pm2_env.ENABLE_NODE_LOG;
70-
7160
if (!env.NODE_LOG_DIR.endsWith('/')) {
7261
env.NODE_LOG_DIR += '/';
7362
}

0 commit comments

Comments
 (0)