mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
feature: allow sweeping of inactive request buckets
This commit is contained in:
@@ -13,6 +13,15 @@ class RESTManager {
|
||||
this.tokenPrefix = tokenPrefix;
|
||||
this.versioned = true;
|
||||
this.timeDifferences = [];
|
||||
if (client.options.restSweepInterval > 0) {
|
||||
client.setInterval(() => {
|
||||
for (const handler in this.handlers) {
|
||||
if (this.handlers[handler] && this.handlers[handler]._inactive) {
|
||||
this.handlers[handler] = undefined;
|
||||
}
|
||||
}
|
||||
}, client.options.restSweepInterval * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
get api() {
|
||||
|
||||
Reference in New Issue
Block a user