Skip to content

Commit

Permalink
fix(api): match any mounts that are present at /mnt/host_*
Browse files Browse the repository at this point in the history
fixes #108
  • Loading branch information
MauriceNino committed Jun 10, 2022
1 parent 89d9fcc commit 810e5a6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions apps/api/src/dynamic-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,10 @@ export const getDynamicServerInfo = () => {
1,
CONFIG.storage_poll_interval,
async (): Promise<StorageLoad> => {
const [disks, sizes] = await Promise.all([si.diskLayout(), si.fsSize()]);
const devices = disks.map(({ device }) => device);
const sizes = await si.fsSize();

const filtered = sizes.filter(
({ fs, mount }) =>
(devices.some(dev => fs.startsWith(dev)) || fs === 'overlay') &&
!mount.startsWith('/etc')
({ fs, mount }) => mount.startsWith('/mnt/host_') || fs === 'overlay'
);

return filtered.reduce((acc, { used }) => acc + used, 0);
Expand Down

0 comments on commit 810e5a6

Please sign in to comment.