Permalink
Browse files

Merge pull request #33 from Mango-information-systems/master

#32 fixed 'sleep_duration' variable use inside function handleRateLimit
  • Loading branch information...
2 parents e0bcc35 + aea178f commit 836484e2152e9558520aa711f5c40aa3e5d6c86f @impronunciable committed Aug 18, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/tuiter.js
View
@@ -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);
};
/*

0 comments on commit 836484e

Please sign in to comment.