mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
chore(logging): output active handles per 10 minutes
This commit is contained in:
@@ -10,6 +10,7 @@ var isProd = nconf.get('NODE_ENV') === 'production';
|
||||
var isDev = nconf.get('NODE_ENV') === 'development';
|
||||
var DISABLE_LOGGING = nconf.get('DISABLE_REQUEST_LOGGING');
|
||||
var cores = +nconf.get("WEB_CONCURRENCY") || 0;
|
||||
var activeHandles = require('active-handles');
|
||||
|
||||
if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
|
||||
// Fork workers. If config.json has CORES=x, use that - otherwise, use all cpus-1 (production)
|
||||
@@ -161,4 +162,10 @@ if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
|
||||
});
|
||||
|
||||
module.exports = server;
|
||||
|
||||
var activeHandleInterval = setInterval(logHandles,600000);
|
||||
|
||||
function logHandles() {
|
||||
activeHandles.print();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user