diff options
author | Mr2u <46743919+Mr2u@users.noreply.github.com> | 2021-10-13 19:33:39 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-13 19:33:39 +1100 |
commit | 625853a47ed187c1788d21671e1151b1fa6f68a0 (patch) | |
tree | adf0a01f6aceb59220bf3f366f94a89db48f8b83 /util/src | |
parent | added route /guilds/:id/prune GET count and POST prune. (diff) | |
parent | :pencil: improve logging (diff) | |
download | server-625853a47ed187c1788d21671e1151b1fa6f68a0.tar.xz |
Merge branch 'fosscord:master' into master
Diffstat (limited to 'util/src')
-rw-r--r-- | util/src/util/Event.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/util/src/util/Event.ts b/util/src/util/Event.ts index bf9547b1..8ed009d5 100644 --- a/util/src/util/Event.ts +++ b/util/src/util/Event.ts @@ -46,7 +46,9 @@ export async function listenEvent(event: string, callback: (event: EventOpts) => } else { const cancel = () => { events.removeListener(event, callback); + events.setMaxListeners(events.getMaxListeners() - 1); }; + events.setMaxListeners(events.getMaxListeners() + 1); events.addListener(event, (opts) => callback({ ...opts, cancel })); return cancel; |