mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #3992 from node-red/fix-mqtt-reconnect
Fix mqtt nodes not reconnecting on modified-flows deploy
This commit is contained in:
commit
e0d71abdc6
@ -718,9 +718,10 @@ module.exports = function(RED) {
|
|||||||
node.deregister = function(mqttNode, done, autoDisconnect) {
|
node.deregister = function(mqttNode, done, autoDisconnect) {
|
||||||
delete node.users[mqttNode.id];
|
delete node.users[mqttNode.id];
|
||||||
if (autoDisconnect && !node.closing && node.connected && Object.keys(node.users).length === 0) {
|
if (autoDisconnect && !node.closing && node.connected && Object.keys(node.users).length === 0) {
|
||||||
node.disconnect();
|
node.disconnect(done);
|
||||||
|
} else {
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
done();
|
|
||||||
};
|
};
|
||||||
node.canConnect = function() {
|
node.canConnect = function() {
|
||||||
return !node.connected && !node.connecting;
|
return !node.connected && !node.connecting;
|
||||||
|
Loading…
Reference in New Issue
Block a user