fix memory checking issue

merge-requests/4/head
Matthew 2020-03-29 05:47:42 -04:00
parent 2cec8a45ae
commit 4f6233548b
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,7 @@ import { RichEmbed } from '../class';
const channelID = '691824484230889546';
export const memoryLimits = {
const memoryLimits = {
TIER_1_SOFT: 200,
TIER_1_HARD: 350,
TIER_2_SOFT: 350,
@ -24,6 +24,7 @@ export default function memory(client: Client) {
const mem = Number(await client.util.exec(`memory ${acc.username}`)) * 1000;
// 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 };
@ -32,6 +33,7 @@ export default function memory(client: Client) {
} else if (acc.tier === 3) {
userLimits = { soft: memoryLimits.TIER_3_SOFT, hard: memoryLimits.TIER_3_HARD };
}
console.log(userLimits);
/* if the user has exceeded their soft memory limit, which is the one described in the
resource limit guidelines, we'll inform staff.