memory int various fixes
parent
ee2ea41d8b
commit
b5a1744002
|
@ -37,7 +37,7 @@ export default function memory(client: Client) {
|
||||||
/* 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.
|
||||||
*/
|
*/
|
||||||
if (memoryConversion >= userLimits.hard && set.has(acc.username)) {
|
if ((memoryConversion >= userLimits.hard) && set.has(acc.username)) {
|
||||||
client.signale.info(`RAM Hard Limit Reached | ${acc.username} | ${memoryConversion}/${userLimits.hard} MB`);
|
client.signale.info(`RAM Hard Limit Reached | ${acc.username} | ${memoryConversion}/${userLimits.hard} MB`);
|
||||||
client.util.exec(`killall -9 -u ${acc.username}`);
|
client.util.exec(`killall -9 -u ${acc.username}`);
|
||||||
const embed = new RichEmbed();
|
const embed = new RichEmbed();
|
||||||
|
@ -64,7 +64,7 @@ export default function memory(client: Client) {
|
||||||
});
|
});
|
||||||
client.createMessage(channelID, { embed });
|
client.createMessage(channelID, { embed });
|
||||||
set.delete(acc.username);
|
set.delete(acc.username);
|
||||||
} else if (memoryConversion >= userLimits.soft && !set.has(acc.username)) {
|
} else if ((memoryConversion >= userLimits.soft) && !set.has(acc.username)) {
|
||||||
client.signale.info(`RAM Soft Limit Reached | ${acc.username} | ${memoryConversion}/${userLimits.soft} MB`);
|
client.signale.info(`RAM Soft Limit Reached | ${acc.username} | ${memoryConversion}/${userLimits.soft} MB`);
|
||||||
const embed = new RichEmbed();
|
const embed = new RichEmbed();
|
||||||
if (client.users.get(acc.userID)) embed.setThumbnail(client.users.get(acc.userID).avatarURL);
|
if (client.users.get(acc.userID)) embed.setThumbnail(client.users.get(acc.userID).avatarURL);
|
||||||
|
@ -81,14 +81,14 @@ export default function memory(client: Client) {
|
||||||
.setTitle('Cloud Account | Notification')
|
.setTitle('Cloud Account | Notification')
|
||||||
.setDescription(`You are about to reach your RAM resource limits, you are currently using '${String(memoryConversion)} MB' and your limit is '${String(userLimits.hard)} MB'. Please correct your usage to avoid further action.`)
|
.setDescription(`You are about to reach your RAM resource limits, you are currently using '${String(memoryConversion)} MB' and your limit is '${String(userLimits.hard)} MB'. Please correct your usage to avoid further action.`)
|
||||||
.addField('Technician', 'SYSTEM', true)
|
.addField('Technician', 'SYSTEM', true)
|
||||||
.setFooter(this.client.user.username, this.client.user.avatarURL)
|
.setFooter(client.user.username, client.user.avatarURL)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
this.client.getDMChannel(acc.userID).then((channel) => {
|
client.getDMChannel(acc.userID).then((channel) => {
|
||||||
channel.createMessage({ notifyEmbed });
|
channel.createMessage({ embed: notifyEmbed });
|
||||||
});
|
});
|
||||||
notifyEmbed.addField('User', `${acc.username} | <@${acc.userID}>`, true);
|
notifyEmbed.addField('User', `${acc.username} | <@${acc.userID}>`, true);
|
||||||
this.client.createMessage('580950455581147146', { embed });
|
client.createMessage('580950455581147146', { embed });
|
||||||
this.client.util.transport.sendMail({
|
client.util.transport.sendMail({
|
||||||
to: acc.emailAddress,
|
to: acc.emailAddress,
|
||||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||||
subject: 'Notification',
|
subject: 'Notification',
|
||||||
|
|
Loading…
Reference in New Issue