Compare commits

...

2 Commits

Author SHA1 Message Date
yumeko d81266201e Merge branch 'fix/server-stats-disable' into 'develop'
Fix check for whether stats are disabled in meta in server machine stats job


See merge request firefish/firefish!10748
2024-04-17 12:02:09 +00:00
yumeko bf3c0717b9 Fix check for whether stats are disabled in meta in server machine stats job 2024-04-16 15:29:18 +00:00
1 changed files with 3 additions and 4 deletions

View File

@ -13,16 +13,15 @@ const round = (num: number) => Math.round(num * 10) / 10;
/**
* Report server stats regularly
*/
export default function () {
export default async function () {
const log = [] as any[];
ev.on("requestServerStatsLog", (x) => {
ev.emit(`serverStatsLog:${x.id}`, log.slice(0, x.length || 50));
});
fetchMeta(true).then((meta) => {
if (!meta.enableServerMachineStats) return;
});
const meta = await fetchMeta(true);
if (!meta.enableServerMachineStats) return;
async function tick() {
const cpu = await cpuUsage();