merge-requests/4/head
Matthew 2020-05-03 17:56:27 -04:00
parent 4f1a9b01d9
commit a67cc4d595
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 4 additions and 3 deletions

View File

@ -1,3 +1,4 @@
/* eslint-disable no-await-in-loop */
import { Client } from '..';
export default async function existingLimitsSetup(client: Client): Promise<number> {
@ -10,15 +11,15 @@ export default async function existingLimitsSetup(client: Client): Promise<numbe
for (const account of accounts) {
if (account.tier === 1) {
account.updateOne({ $set: { ramLimitNotification: tier1.resourceLimits.ram - 20 } });
await client.db.Account.updateOne({ userID: account.userID }, { $set: { ramLimitNotification: tier1.resourceLimits.ram - 20 } });
numOfAccountsUpdated += 1;
}
if (account.tier === 2) {
account.updateOne({ $set: { ramLimitNotification: tier2.resourceLimits.ram - 20 } });
await client.db.Account.updateOne({ userID: account.userID }, { $set: { ramLimitNotification: tier2.resourceLimits.ram - 20 } });
numOfAccountsUpdated += 1;
}
if (account.tier === 3) {
account.updateOne({ $set: { ramLimitNotification: tier3.resourceLimits.ram - 20 } });
await client.db.Account.updateOne({ userID: account.userID }, { $set: { ramLimitNotification: tier3.resourceLimits.ram - 20 } });
numOfAccountsUpdated += 1;
}
}