fix: burst request mode hanging permanently

This commit is contained in:
Lewdcario
2018-05-11 19:27:34 -05:00
parent de7d90ada3
commit 379061987c

View File

@@ -62,7 +62,8 @@ class BurstRequestHandler extends RequestHandler {
handle() {
super.handle();
if (this.remaining <= 0 || this.queue.length === 0 || this.globalLimit) return;
if (this.queue.length === 0) return;
if ((this.remaining <= 0 || this.globalLimit) && Date.now() - this.timeDifference < this.resetTime) return;
this.execute(this.queue.shift());
this.remaining--;
this.handle();