fix(worker): default to disk 0 if /host/root not found

In order to avoid displaying 0 disk space on some systems, we default to the first disk found
This commit is contained in:
Nicolas Meienberger 2023-11-28 08:18:48 +01:00 committed by Nicolas Meienberger
parent 0f129a7809
commit 852128f551

View file

@ -37,7 +37,7 @@ export class SystemExecutors {
} }
const disks = await si.fsSize(); const disks = await si.fsSize();
const disk0 = disks.find((disk) => disk.mount.startsWith('/host/root')); const disk0 = disks.find((disk) => disk.mount.startsWith('/host/root')) || disks[0];
return { return {
cpu: { load: currentLoad }, cpu: { load: currentLoad },