From 687e7675659be6b07cf62378217a25e1cd587eca Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 28 Nov 2020 02:02:29 -0500 Subject: [PATCH] performance fixes --- src/class/Queue.ts | 2 +- src/commands/notes.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/class/Queue.ts b/src/class/Queue.ts index 65f5623..91561f4 100644 --- a/src/class/Queue.ts +++ b/src/class/Queue.ts @@ -15,7 +15,7 @@ export default class Queue { constructor(client: Client) { this.client = client; this.queues = { - score: new Bull('score', { prefix: 'queue::score', limiter: { max: 80, duration: 1000 } }), + score: new Bull('score', { prefix: 'queue::score' }), }; this.setProcessors(); this.setCronJobs(); diff --git a/src/commands/notes.ts b/src/commands/notes.ts index 6c3b5a7..b711a8a 100644 --- a/src/commands/notes.ts +++ b/src/commands/notes.ts @@ -17,7 +17,13 @@ export default class Notes extends Command { try { if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); let member: Member | User = this.client.util.resolveMember(args[0], this.mainGuild); - if (!member) member = await this.client.getRESTUser(args[0]); + if (!member) { + try { + member = await this.client.getRESTUser(args[0]); + } catch { + member = undefined; + } + } if (!member) return this.error(message.channel, 'User specified could not be found.'); const notes = await this.client.db.Note.find({ userID: member.id });