Permalink
Browse files

#32 fixed 'sleep_duration' variable use inside function handleRateLimit

  • Loading branch information...
1 parent e0bcc35 commit aea178fdbec5b182457f12ea61aaf48176a6a5e0 @mef mef 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 aea178f

Please sign in to comment.