forked from engineering/cloudservices
fix memory checking issue
parent
2cec8a45ae
commit
4f6233548b
|
@ -5,7 +5,7 @@ import { RichEmbed } from '../class';
|
||||||
|
|
||||||
const channelID = '691824484230889546';
|
const channelID = '691824484230889546';
|
||||||
|
|
||||||
export const memoryLimits = {
|
const memoryLimits = {
|
||||||
TIER_1_SOFT: 200,
|
TIER_1_SOFT: 200,
|
||||||
TIER_1_HARD: 350,
|
TIER_1_HARD: 350,
|
||||||
TIER_2_SOFT: 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;
|
const mem = Number(await client.util.exec(`memory ${acc.username}`)) * 1000;
|
||||||
// memory in megabytes
|
// memory in megabytes
|
||||||
const memoryConversion = mem / 1024 / 1024;
|
const memoryConversion = mem / 1024 / 1024;
|
||||||
|
console.log(memoryLimits);
|
||||||
let userLimits: { soft: number, hard: number };
|
let userLimits: { soft: number, hard: number };
|
||||||
if (acc.tier === 1) {
|
if (acc.tier === 1) {
|
||||||
userLimits = { soft: memoryLimits.TIER_1_SOFT, hard: memoryLimits.TIER_1_HARD };
|
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) {
|
} else if (acc.tier === 3) {
|
||||||
userLimits = { soft: memoryLimits.TIER_3_SOFT, hard: memoryLimits.TIER_3_HARD };
|
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
|
/* if the user has exceeded their soft memory limit, which is the one described in the
|
||||||
resource limit guidelines, we'll inform staff.
|
resource limit guidelines, we'll inform staff.
|
||||||
|
|
Loading…
Reference in New Issue