Merge branch 'fix/server-stats-disable' into 'develop'

Fix check for whether stats are disabled in meta in server machine stats job

Co-authored-by: yumeko <yumeko@mainichi.social>

See merge request firefish/firefish!10748
This commit is contained in:
naskya 2024-04-17 18:20:35 +00:00
commit 6a94d1b65d
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();