mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 15:38:59 +00:00
fix(logging): only start Stackimpact in prod (#10112)
This commit is contained in:
parent
37650ca674
commit
5f0b957dc2
2 changed files with 9 additions and 6 deletions
|
|
@ -112,5 +112,6 @@
|
||||||
"CLOUDKARAFKA_USERNAME": "",
|
"CLOUDKARAFKA_USERNAME": "",
|
||||||
"CLOUDKARAFKA_PASSWORD": "",
|
"CLOUDKARAFKA_PASSWORD": "",
|
||||||
"CLOUDKARAFKA_TOPIC_PREFIX": ""
|
"CLOUDKARAFKA_TOPIC_PREFIX": ""
|
||||||
}
|
},
|
||||||
|
"STACK_IMPACT_KEY": "aaaabbbbccccddddeeeeffffgggg111100002222"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,6 @@ setupNconf();
|
||||||
const nconf = require('nconf');
|
const nconf = require('nconf');
|
||||||
const stackimpact = require('stackimpact');
|
const stackimpact = require('stackimpact');
|
||||||
|
|
||||||
stackimpact.start({
|
|
||||||
agentKey: nconf.get('STACK_IMPACT_KEY'),
|
|
||||||
appName: 'Habitica',
|
|
||||||
});
|
|
||||||
|
|
||||||
const cluster = require('cluster');
|
const cluster = require('cluster');
|
||||||
const logger = require('./libs/logger');
|
const logger = require('./libs/logger');
|
||||||
|
|
||||||
|
|
@ -32,6 +27,13 @@ const IS_PROD = nconf.get('IS_PROD');
|
||||||
const IS_DEV = nconf.get('IS_DEV');
|
const IS_DEV = nconf.get('IS_DEV');
|
||||||
const CORES = Number(nconf.get('WEB_CONCURRENCY')) || 0;
|
const CORES = Number(nconf.get('WEB_CONCURRENCY')) || 0;
|
||||||
|
|
||||||
|
if (IS_PROD) {
|
||||||
|
stackimpact.start({
|
||||||
|
agentKey: nconf.get('STACK_IMPACT_KEY'),
|
||||||
|
appName: 'Habitica',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Setup the cluster module
|
// Setup the cluster module
|
||||||
if (CORES !== 0 && cluster.isMaster && (IS_DEV || IS_PROD)) {
|
if (CORES !== 0 && cluster.isMaster && (IS_DEV || IS_PROD)) {
|
||||||
// Fork workers. If config.json has WEB_CONCURRENCY=x, use that - otherwise, use all cpus-1 (production)
|
// Fork workers. If config.json has WEB_CONCURRENCY=x, use that - otherwise, use all cpus-1 (production)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue