Webpack build for branch master: 8b8a365e99

This commit is contained in:
Travis CI 2017-08-20 08:17:59 +00:00
parent b8a8f0c2a9
commit 099c71131d
2 changed files with 5 additions and 3 deletions

View file

@ -17652,6 +17652,7 @@ class WebSocketConnection extends EventEmitter {
this.ratelimit = { this.ratelimit = {
queue: [], queue: [],
remaining: 60, remaining: 60,
total: 60,
resetTimer: null, resetTimer: null,
}; };
this.connect(gateway); this.connect(gateway);
@ -17760,9 +17761,9 @@ class WebSocketConnection extends EventEmitter {
processQueue() { processQueue() {
if (this.ratelimit.remaining === 0) return; if (this.ratelimit.remaining === 0) return;
if (this.ratelimit.queue.length === 0) return; if (this.ratelimit.queue.length === 0) return;
if (this.ratelimit.remaining === 120) { if (this.ratelimit.remaining === this.ratelimit.total) {
this.ratelimit.resetTimer = this.client.setTimeout(() => { this.ratelimit.resetTimer = this.client.setTimeout(() => {
this.ratelimit.remaining = 60; this.ratelimit.remaining = this.ratelimit.total;
this.processQueue(); this.processQueue();
}, 120e3); }, 120e3);
} }
@ -17846,6 +17847,7 @@ class WebSocketConnection extends EventEmitter {
this.packetManager.handleQueue(); this.packetManager.handleQueue();
this.ws = null; this.ws = null;
this.status = Constants.Status.DISCONNECTED; this.status = Constants.Status.DISCONNECTED;
this.ratelimit.remaining = this.ratelimit.total;
return true; return true;
} }

File diff suppressed because one or more lines are too long