more fixes
parent
5072aab510
commit
c13c19c080
|
@ -15,6 +15,26 @@ export default class Queue {
|
|||
this.setProcessors();
|
||||
}
|
||||
|
||||
public async jobCounts() {
|
||||
const data = {
|
||||
waiting: 0,
|
||||
active: 0,
|
||||
completed: 0,
|
||||
failed: 0,
|
||||
delayed: 0,
|
||||
};
|
||||
for (const entry of Object.entries(this.queues)) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const counts = await entry[1].getJobCounts();
|
||||
data.waiting += counts.waiting;
|
||||
data.active += counts.active;
|
||||
data.completed += counts.completed;
|
||||
data.failed += counts.failed;
|
||||
data.delayed += counts.delayed;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
protected listeners() {
|
||||
this.queues.score.on('active', (job) => {
|
||||
this.client.util.signale.pending(`${job.id} has become active.`);
|
||||
|
|
|
@ -26,6 +26,7 @@ export default class Stats extends Command {
|
|||
embed.addField('Commands Executed', `${commands.value}`, true);
|
||||
embed.addField('HTTP Requests Served', `${requests.value}`, true);
|
||||
embed.addField('Pages Sent', `${pages.value}`, true);
|
||||
embed.addField('Jobs Processed', `${(await this.client.queue.jobCounts()).completed}`, true);
|
||||
embed.setFooter(this.client.user.username, this.client.user.avatarURL);
|
||||
embed.setTimestamp();
|
||||
return message.channel.createMessage({ embed });
|
||||
|
|
Loading…
Reference in New Issue