merge: fix: prevent error spam from ServerStatsService when running on Windows (!600)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/600

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <2-Marie@users.noreply.activitypub.software>
This commit is contained in:
dakkar 2024-08-17 19:05:36 +00:00
commit 38f25ab1b7

View file

@ -108,5 +108,6 @@ async function net() {
// FS STAT
async function fs() {
return await si.disksIO().catch(() => ({ rIO_sec: 0, wIO_sec: 0 }));
const io = await si.disksIO().catch(() => null);
return io ?? { rIO_sec: 0, wIO_sec: 0 };
}