Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

#32 fixed 'sleep_duration' variable use inside function handleRateLimit #33

Merged
merged 1 commit into from

2 participants

@mef

replaced wrong variable name sleep_duration by self.sleep_duration in two places, should solve the issue.

@impronunciable impronunciable merged commit 836484e into impronunciable:master
@impronunciable

Thanks!

@mef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/tuiter.js
View
4 lib/tuiter.js
@@ -194,12 +194,12 @@ Tuiter.prototype.resetTimers = function() {
Tuiter.prototype.handleRateLimit = function(res) {
var self = this;
self.sleep_duration = (res.header['x-rate-limit-reset']*1000 - new Date()) + 7000;
- debug('rate limit reached, sleeping during', Math.ceil(sleep_duration/60000), 'minutes');
+ debug('rate limit reached, sleeping during', Math.ceil(self.sleep_duration/60000), 'minutes');
setTimeout(function() {
debug('rate limit reset, resuming extraction...');
params = preProcess(res.tuiter.params);
self.APIRequest(res.tuiter.endpoint, res.tuiter.params, res.tuiter.callback);
- }, sleep_duration);
+ }, self.sleep_duration);
};
/*
Something went wrong with that request. Please try again.