diff --git a/social/pushbullet/57-pushbullet.js b/social/pushbullet/57-pushbullet.js index d65afc5a..199547aa 100644 --- a/social/pushbullet/57-pushbullet.js +++ b/social/pushbullet/57-pushbullet.js @@ -125,6 +125,7 @@ module.exports = function(RED) { stream.on('close', function() { self.emitter.emit('stream_disconnected'); if (!closing) { + if (tout) { clearTimeout(tout); } tout = setTimeout(function() { stream.connect(); }, 15000); @@ -133,6 +134,7 @@ module.exports = function(RED) { stream.on('error', function(err) { self.emitter.emit('stream_error', err); if (!closing) { + if (tout) { clearTimeout(tout); } tout = setTimeout(function() { stream.connect(); }, 15000);