Merge pull request #701 from guzba/patch-1
Attempt to mitigate stream server connect feedback loop
This commit is contained in:
commit
1253e7b6be
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue