1
0
Fork 0

fix memory checking issue

refactor/models
Matthew 2020-03-29 05:53:15 -04:00
parent 6ebddbf9e0
commit c5ddad81c7
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 17 additions and 8 deletions

View File

@ -25,13 +25,22 @@ export default function memory(client: Client) {
// memory in megabytes
const memoryConversion = mem / 1024 / 1024;
console.log(memoryLimits);
let userLimits: { soft: number, hard: number };
if (acc.tier === 1) {
userLimits = { soft: memoryLimits.TIER_1_SOFT, hard: memoryLimits.TIER_1_HARD };
} else if (acc.tier === 2) {
userLimits = { soft: memoryLimits.TIER_2_SOFT, hard: memoryLimits.TIER_2_HARD };
} else if (acc.tier === 3) {
userLimits = { soft: memoryLimits.TIER_3_SOFT, hard: memoryLimits.TIER_3_HARD };
const userLimits: { soft?: number, hard?: number } = {};
switch (acc.tier) {
case 1:
userLimits.soft = memoryLimits.TIER_1_SOFT;
userLimits.hard = memoryLimits.TIER_1_HARD;
break;
case 2:
userLimits.soft = memoryLimits.TIER_2_SOFT;
userLimits.hard = memoryLimits.TIER_2_HARD;
break;
case 3:
userLimits.soft = memoryLimits.TIER_3_SOFT;
userLimits.hard = memoryLimits.TIER_3_HARD;
break;
default:
break;
}
console.log(userLimits);
@ -80,5 +89,5 @@ export default function memory(client: Client) {
} catch (err) {
client.util.handleError(err);
}
}, 30000);
}, 60000);
}