mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Update packages/node_modules/@node-red/nodes/core/network/10-mqtt.js
Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
This commit is contained in:
parent
82672a825d
commit
c87ff3ca26
@ -719,6 +719,11 @@ module.exports = function(RED) {
|
|||||||
setStatusConnecting(node, true);
|
setStatusConnecting(node, true);
|
||||||
try {
|
try {
|
||||||
node.serverProperties = {};
|
node.serverProperties = {};
|
||||||
|
if(node.client) {
|
||||||
|
//belt and braces to avoid left over clients
|
||||||
|
node.client.end(true);
|
||||||
|
node._clientRemoveListeners();
|
||||||
|
}
|
||||||
node.client = mqtt.connect(node.brokerurl, node.options);
|
node.client = mqtt.connect(node.brokerurl, node.options);
|
||||||
node.client.setMaxListeners(0);
|
node.client.setMaxListeners(0);
|
||||||
let callbackDone = false; //prevent re-connects causing node._clientOn('connect' firing callback multiple times
|
let callbackDone = false; //prevent re-connects causing node._clientOn('connect' firing callback multiple times
|
||||||
|
Loading…
Reference in New Issue
Block a user