diff --git a/src/system.js b/src/system.js index b709dc9e3..bc880c3ca 100644 --- a/src/system.js +++ b/src/system.js @@ -12,7 +12,6 @@ exports = module.exports = { const apps = require('./apps.js'), assert = require('assert'), BoxError = require('./boxerror.js'), - constants = require('./constants.js'), debug = require('debug')('box:disks'), df = require('@sindresorhus/df'), docker = require('./docker.js'), @@ -88,7 +87,7 @@ async function getDisks() { } for (const app of await apps.list()) { - if (app.manifest.id === constants.PROXY_APP_APPSTORE_ID) continue; + if (!app.manifest.addons?.localstorage) continue; const dataDir = await apps.getStorageDir(app); const [, dfResult] = await safe(df.file(dataDir)); @@ -170,7 +169,9 @@ async function updateDiskUsage(progressCallback) { if (content.id === 'docker') { content.usage = (await docker.df()).LayersSize; } else { - content.usage = await du(content.path); + const [error, usage] = await safe(du(content.path)); + if (error) progressCallback({ message: `du error: ${error.message}`}); // can happen if app is installing etc + content.usage = usage || 0; } progressCallback({ message: `du of ${JSON.stringify(content)}: ${content.usage}`}); }