diff --git a/core/core.js b/core/core.js index 8cd9dbee2..cf9fcbeec 100644 --- a/core/core.js +++ b/core/core.js @@ -793,15 +793,12 @@ async function loadSettings() { } function sendStats() { - var any = false; - for (var process of Object.values(gProcesses)) { - if (process.app && process.stats) { - process.app.send({action: 'stats', stats: getStats()}); - any = true; + let apps = Object.values(gProcesses).filter(process => process.app && process.stats).map(process => process.app); + if (apps.length) { + let stats = getStats(); + for (let app of apps) { + app.send({action: 'stats', stats: stats}); } - } - - if (any) { setTimeout(sendStats, 1000); } else { gStatsTimer = false;