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:
@@ -4,6 +4,7 @@
|
||||
"version": "0.0.0-152",
|
||||
"main": "./website/src/server.js",
|
||||
"dependencies": {
|
||||
"active-handles": "^1.1.0",
|
||||
"amazon-payments": "0.0.4",
|
||||
"amplitude": "^2.0.3",
|
||||
"async": "~0.9.0",
|
||||
|
||||
@@ -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