1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

ensure trigger doesn't set two simultaneous timeouts

This commit is contained in:
Dave Conway-Jones 2018-02-04 20:17:43 +00:00
parent 22d942b705
commit ff05fb14a6
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4

View File

@ -113,6 +113,7 @@ module.exports = function(RED) {
}
}
else {
if (!node.topics[topic].tout) {
node.topics[topic].tout = setTimeout(function() {
var msg2 = null;
if (node.op2type !== "nul") {
@ -121,12 +122,13 @@ module.exports = function(RED) {
node.topics[topic].m2 = RED.util.evaluateNodeProperty(node.op2,node.op2type,node,msg);
}
msg2.payload = node.topics[topic].m2;
}
delete node.topics[topic];
node.status({});
node.send(msg2);
}
node.status({});
}, node.duration);
}
}
node.status({fill:"blue",shape:"dot",text:" "});
}
else if ((node.extend === "true" || node.extend === true) && (node.duration > 0)) {