From cbeb964b218e676b204e799b13962d86dc28ea7f Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 9 Nov 2019 23:13:49 -0500 Subject: [PATCH] change interval timing on storage --- src/intervals/storage.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/intervals/storage.ts b/src/intervals/storage.ts index 68bc6c8..799a14c 100644 --- a/src/intervals/storage.ts +++ b/src/intervals/storage.ts @@ -3,7 +3,7 @@ import fs from 'fs-extra'; import { Client } from '..'; export default function storage(client: Client) { - setInterval(async () => { + 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}`)); @@ -15,5 +15,8 @@ export default function storage(client: Client) { } await client.redis.set(`storage-${account.username}`, bytes); } + }; + setInterval(async () => { + await main(); }, 300000); }