box data is separate from mail data already

This commit is contained in:
Girish Ramakrishnan
2022-10-12 11:59:28 +02:00
parent 4a3d85a269
commit 4fe0402735
2 changed files with 5 additions and 12 deletions

View File

@@ -27,11 +27,10 @@ const apps = require('./apps.js'),
const DU_CMD = path.join(__dirname, 'scripts/du.sh');
async function du(file, options) {
async function du(file) {
assert.strictEqual(typeof file, 'string');
assert.strictEqual(typeof options, 'object');
const [error, stdoutResult] = await safe(shell.promises.sudo('system', [ DU_CMD, file, options.exclude || '' ], {}));
const [error, stdoutResult] = await safe(shell.promises.sudo('system', [ DU_CMD, file ], {}));
if (error) throw new BoxError(BoxError.FS_ERROR, error);
return parseInt(stdoutResult.trim(), 10);
@@ -61,7 +60,7 @@ async function getDisks() {
const standardPaths = [
{ type: 'standard', id: 'platformdata', path: paths.PLATFORM_DATA_DIR },
{ type: 'standard', id: 'boxdata', path: paths.BOX_DATA_DIR, exclude: 'mail' },
{ type: 'standard', id: 'boxdata', path: paths.BOX_DATA_DIR },
{ type: 'standard', id: 'maildata', path: paths.MAIL_DATA_DIR },
];
@@ -171,7 +170,7 @@ async function updateDiskUsage(progressCallback) {
if (content.id === 'docker') {
content.usage = (await docker.df()).LayersSize;
} else {
content.usage = await du(content.path, { exclude: content.exclude });
content.usage = await du(content.path);
}
progressCallback({ message: `du of ${JSON.stringify(content)}: ${content.usage}`});
}