Fix stats.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3869 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2022-04-20 23:45:17 +00:00
parent 0d1b231344
commit 2826efea56
2 changed files with 10 additions and 5 deletions

View File

@ -141,11 +141,7 @@ function socket(request, response, client) {
}
} else if (message.action == 'enableStats') {
if (process) {
process.stats = message.enabled;
if (!gStatsTimer) {
sendStats();
gStatsTimer = true;
}
core.enableStats(process, message.enabled);
}
} else {
if (process && process.eventHandlers['message']) {

View File

@ -559,6 +559,14 @@ function sendStats() {
}
}
function enableStats(process, enabled) {
process.stats = enabled;
if (!gStatsTimer) {
gStatsTimer = true;
sendStats();
}
}
loadSettings().then(function() {
var auth = require("auth");
var httpd = require("httpd");
@ -601,3 +609,4 @@ exports.getSessionProcessBlob = getSessionProcessBlob;
exports.invoke = invoke;
exports.globalSettings = gGlobalSettings;
exports.setGlobalSettings = setGlobalSettings;
exports.enableStats = enableStats;