mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
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() {
|
stream.on('close', function() {
|
||||||
self.emitter.emit('stream_disconnected');
|
self.emitter.emit('stream_disconnected');
|
||||||
if (!closing) {
|
if (!closing) {
|
||||||
|
if (tout) { clearTimeout(tout); }
|
||||||
tout = setTimeout(function() {
|
tout = setTimeout(function() {
|
||||||
stream.connect();
|
stream.connect();
|
||||||
}, 15000);
|
}, 15000);
|
||||||
@ -133,6 +134,7 @@ module.exports = function(RED) {
|
|||||||
stream.on('error', function(err) {
|
stream.on('error', function(err) {
|
||||||
self.emitter.emit('stream_error', err);
|
self.emitter.emit('stream_error', err);
|
||||||
if (!closing) {
|
if (!closing) {
|
||||||
|
if (tout) { clearTimeout(tout); }
|
||||||
tout = setTimeout(function() {
|
tout = setTimeout(function() {
|
||||||
stream.connect();
|
stream.connect();
|
||||||
}, 15000);
|
}, 15000);
|
||||||
|
Loading…
Reference in New Issue
Block a user