From e40d8fe47f63db3c01caf8ffdc0eda93bbff94c3 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 9 Nov 2019 23:23:26 -0500 Subject: [PATCH] fix issue with storage --- src/intervals/storage.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/intervals/storage.ts b/src/intervals/storage.ts index 799a14c..19f08e4 100644 --- a/src/intervals/storage.ts +++ b/src/intervals/storage.ts @@ -6,10 +6,11 @@ export default function storage(client: Client) { const main = async () => { const accounts = await client.db.Account.find(); for (const account of accounts) { - let bytes = Number(await client.util.exec(`du -bs /home/${account.username}`)); + const res = await client.util.exec(`du -bs /home/${account.username}`); + let bytes = Number(res.split('/')[0].replace('\t', '')); try { await fs.access(`/var/mail/${account.username}`, fs.constants.F_OK); - bytes += Number(await client.util.exec(`du -bs /var/mail/${account.username}`)); + bytes += Number(res.split('/')[0].replace('\t', '')); } catch { bytes += 0; }