mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
make sure stomp client calls done on close.
This commit is contained in:
parent
31318b03d7
commit
97d271be2c
@ -90,12 +90,11 @@ module.exports = function(RED) {
|
||||
node.on("close", function(done) {
|
||||
closing = true;
|
||||
if (node.client) {
|
||||
node.client.on("disconnect", function() {
|
||||
done();
|
||||
});
|
||||
node.client.on("disconnect", function() { done(); });
|
||||
//node.client.unsubscribe(node.topic);
|
||||
node.client.disconnect();
|
||||
} else { done(); }
|
||||
}
|
||||
else { done(); }
|
||||
});
|
||||
}
|
||||
RED.nodes.registerType("stomp in",StompInNode);
|
||||
@ -143,7 +142,11 @@ module.exports = function(RED) {
|
||||
|
||||
node.on("close", function(done) {
|
||||
closing = true;
|
||||
if (client) { client.disconnect(); }
|
||||
if (node.client) {
|
||||
node.client.on("disconnect", function() { done(); });
|
||||
node.client.disconnect();
|
||||
}
|
||||
else { done(); }
|
||||
});
|
||||
}
|
||||
RED.nodes.registerType("stomp out",StompOutNode);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-stomp",
|
||||
"version" : "0.0.3",
|
||||
"version" : "0.0.4",
|
||||
"description" : "A Node-RED node to publish and subscribe to/from a Stomp server",
|
||||
"dependencies" : {
|
||||
"stomp-client" : "0.6.2"
|
||||
|
Loading…
Reference in New Issue
Block a user