mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
fix(logging): move Stackdriver init higher up (#11025)
This commit is contained in:
committed by
Matteo Pagliazzi
parent
80b15ac5e9
commit
901d11c61f
@@ -10,13 +10,17 @@ if (process.env.NODE_ENV !== 'production') {
|
|||||||
// Initialize configuration BEFORE anything
|
// Initialize configuration BEFORE anything
|
||||||
const setupNconf = require('./libs/setupNconf');
|
const setupNconf = require('./libs/setupNconf');
|
||||||
setupNconf();
|
setupNconf();
|
||||||
|
|
||||||
const nconf = require('nconf');
|
const nconf = require('nconf');
|
||||||
|
|
||||||
|
const IS_PROD = nconf.get('IS_PROD');
|
||||||
|
const STACKDRIVER_TRACING_ENABLED = nconf.get('ENABLE_STACKDRIVER_TRACING') === 'true';
|
||||||
|
if (IS_PROD && STACKDRIVER_TRACING_ENABLED) {
|
||||||
|
require('@google-cloud/trace-agent').start(); // eslint-disable-line global-require
|
||||||
|
}
|
||||||
|
|
||||||
const cluster = require('cluster');
|
const cluster = require('cluster');
|
||||||
const logger = require('./libs/logger');
|
const logger = require('./libs/logger');
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,6 @@ import logger from './libs/logger';
|
|||||||
import express from 'express';
|
import express from 'express';
|
||||||
import http from 'http';
|
import http from 'http';
|
||||||
|
|
||||||
const IS_PROD = nconf.get('IS_PROD');
|
|
||||||
const STACKDRIVER_TRACING_ENABLED = nconf.get('ENABLE_STACKDRIVER_TRACING') === 'true';
|
|
||||||
if (IS_PROD && STACKDRIVER_TRACING_ENABLED) {
|
|
||||||
require('@google-cloud/trace-agent').start(); // eslint-disable-line global-require
|
|
||||||
}
|
|
||||||
|
|
||||||
const server = http.createServer();
|
const server = http.createServer();
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user