Merge branch 'rewrite-ratelimit-route-builder'

This commit is contained in:
iCrawl
2017-07-27 03:04:45 +02:00
3 changed files with 3 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ class RequestHandler {
} }
get limited() { get limited() {
return this.queue.length === 0 || this.manager.globallyRateLimited || this.remaining <= 0; return this.manager.globallyRateLimited || this.remaining <= 0;
} }
set globallyLimited(limited) { set globallyLimited(limited) {

View File

@@ -1,5 +1,5 @@
module.exports = function burst() { module.exports = function burst() {
if (this.limited) return; if (this.limited || this.queue.length === 0) return;
this.execute(this.queue.shift()) this.execute(this.queue.shift())
.then(this.handle.bind(this)) .then(this.handle.bind(this))
.catch(({ timeout }) => { .catch(({ timeout }) => {

View File

@@ -1,5 +1,5 @@
module.exports = function sequential() { module.exports = function sequential() {
if (this.busy || this.limited) return; if (this.busy || this.limited || this.queue.length === 0) return;
this.busy = true; this.busy = true;
this.execute(this.queue.shift()) this.execute(this.queue.shift())
.then(() => { .then(() => {