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:
commit
6a94d1b65d
1 changed files with 3 additions and 4 deletions
|
@ -13,16 +13,15 @@ const round = (num: number) => Math.round(num * 10) / 10;
|
||||||
/**
|
/**
|
||||||
* Report server stats regularly
|
* Report server stats regularly
|
||||||
*/
|
*/
|
||||||
export default function () {
|
export default async function () {
|
||||||
const log = [] as any[];
|
const log = [] as any[];
|
||||||
|
|
||||||
ev.on("requestServerStatsLog", (x) => {
|
ev.on("requestServerStatsLog", (x) => {
|
||||||
ev.emit(`serverStatsLog:${x.id}`, log.slice(0, x.length || 50));
|
ev.emit(`serverStatsLog:${x.id}`, log.slice(0, x.length || 50));
|
||||||
});
|
});
|
||||||
|
|
||||||
fetchMeta(true).then((meta) => {
|
const meta = await fetchMeta(true);
|
||||||
if (!meta.enableServerMachineStats) return;
|
if (!meta.enableServerMachineStats) return;
|
||||||
});
|
|
||||||
|
|
||||||
async function tick() {
|
async function tick() {
|
||||||
const cpu = await cpuUsage();
|
const cpu = await cpuUsage();
|
||||||
|
|
Loading…
Reference in a new issue