Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bugfixes with twitter reconnect

  • Loading branch information...
commit 76e8811e1f24f9243c4742f9a82c7fedb19c2271 1 parent c477adf
David Mongeau-Petitpas dmongeau authored
Showing with 9 additions and 3 deletions.
  1. +8 −2 lib/processor.js
  2. +1 −1  package.json
10 lib/processor.js
View
@@ -104,6 +104,8 @@ TwitterProcessor.prototype._startStream = function() {
//On new tweet
stream.on('data', function (tweet) {
+
+ self._retriesCount = 1;
//Add tweet to queue
if(typeof(tweet.text) != 'undefined') {
@@ -118,15 +120,19 @@ TwitterProcessor.prototype._startStream = function() {
console.log('Twitter error',arguments);
}
try {
- self._retriesCount = self._retriesCount * 2;
+ if(self._retriesCount < 300) {
+ self._retriesCount = self._retriesCount * 2;
+ }
stream.destroy();
} catch(e){}
});
//On stream end
stream.on('end', function (response) {
+ if(self.options.debug) {
+ console.log('Twitter end');
+ }
try {
- self._retriesCount = 1;
stream.destroy();
} catch(e){}
});
2  package.json
View
@@ -13,7 +13,7 @@
"David Mongeau-Petitpas <dmp@atelierfolklore.ca>",
"François Côté <fc@atelierfolklore.ca>"
],
- "version": "0.0.9-2",
+ "version": "0.0.9-4",
"dependencies": {
"ntwitter" : "0.5.x",
"queueleuleu" : "0.x"
Please sign in to comment.
Something went wrong with that request. Please try again.