diff --git a/config.json.example b/config.json.example index efaa9298f6..b2549efdbd 100644 --- a/config.json.example +++ b/config.json.example @@ -112,5 +112,6 @@ "CLOUDKARAFKA_USERNAME": "", "CLOUDKARAFKA_PASSWORD": "", "CLOUDKARAFKA_TOPIC_PREFIX": "" - } + }, + "STACK_IMPACT_KEY": "aaaabbbbccccddddeeeeffffgggg111100002222" } diff --git a/website/server/index.js b/website/server/index.js index becea804a4..df9493a08f 100644 --- a/website/server/index.js +++ b/website/server/index.js @@ -20,11 +20,6 @@ setupNconf(); const nconf = require('nconf'); const stackimpact = require('stackimpact'); -stackimpact.start({ - agentKey: nconf.get('STACK_IMPACT_KEY'), - appName: 'Habitica', -}); - const cluster = require('cluster'); const logger = require('./libs/logger'); @@ -32,6 +27,13 @@ const IS_PROD = nconf.get('IS_PROD'); const IS_DEV = nconf.get('IS_DEV'); 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 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)