node-red-node-mysq add done() callback (#793)

This fix adds the done() callback when the query has been executed.
This commit is contained in:
Daniele 2021-04-08 10:11:59 +02:00 committed by GitHub
parent 61a03d7cc3
commit 040bf24c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -123,7 +123,7 @@ module.exports = function(RED) {
}
});
node.on("input", function(msg) {
node.on("input", function(msg, send, done) {
if (node.mydbConfig.connected) {
if (typeof msg.topic === 'string') {
//console.log("query:",msg.topic);
@ -160,6 +160,7 @@ module.exports = function(RED) {
node.send(msg);
status = {fill:"green",shape:"dot",text:"OK"};
node.status(status);
done();
}
// if (node.mydbConfig.pool._freeConnections.indexOf(node.mydbConfig.connection) === -1) {
// node.mydbConfig.connection.release();