Add client.destroy();

This commit is contained in:
Amish Shah
2016-08-30 13:05:50 +01:00
parent 56352220af
commit d249aa10cc
18 changed files with 74 additions and 42 deletions

View File

@@ -30,6 +30,10 @@ class RESTMethods {
});
}
logout() {
return this.rest.makeRequest('post', Constants.Endpoints.logout, true);
}
getGateway() {
return new Promise((resolve, reject) => {
this.rest.makeRequest('get', Constants.Endpoints.gateway, true)

View File

@@ -53,7 +53,7 @@ class SequentialRequestHandler extends RequestHandler {
}
if (err) {
if (err.status === 429) {
setTimeout(() => {
this.restManager.client.setTimeout(() => {
this.waiting = false;
this.globalLimit = false;
resolve();
@@ -73,7 +73,7 @@ class SequentialRequestHandler extends RequestHandler {
const data = res && res.body ? res.body : {};
item.resolve(data);
if (this.requestRemaining === 0) {
setTimeout(() => {
this.restManager.client.setTimeout(() => {
this.waiting = false;
resolve(data);
}, (this.requestResetTime - Date.now()) + this.timeDifference + 1000);