forked from engineering/cloudservices
fix memory checking issue
parent
6ebddbf9e0
commit
c5ddad81c7
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue