mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
mysql test before releasing connection
This commit is contained in:
parent
e674f9ad97
commit
c2613cfeb0
@ -141,7 +141,7 @@ module.exports = function(RED) {
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
node.mydbConfig.pool.query(msg.topic, bind, function(err, rows) {
|
node.mydbConfig.connection.query(msg.topic, bind, function(err, rows) {
|
||||||
if (err) {
|
if (err) {
|
||||||
status = {fill:"red",shape:"ring",text:"Error: "+err.code};
|
status = {fill:"red",shape:"ring",text:"Error: "+err.code};
|
||||||
node.status(status);
|
node.status(status);
|
||||||
@ -156,7 +156,9 @@ module.exports = function(RED) {
|
|||||||
status = {fill:"green",shape:"dot",text:"OK"};
|
status = {fill:"green",shape:"dot",text:"OK"};
|
||||||
node.status(status);
|
node.status(status);
|
||||||
}
|
}
|
||||||
//node.mydbConfig.connection.release();
|
if (node.mydbConfig.pool._freeConnections.indexOf(node.mydbConfig.connection) === -1) {
|
||||||
|
node.mydbConfig.connection.release();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-mysql",
|
"name": "node-red-node-mysql",
|
||||||
"version": "0.1.2",
|
"version": "0.1.3",
|
||||||
"description": "A Node-RED node to read and write to a MySQL database",
|
"description": "A Node-RED node to read and write to a MySQL database",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mysql": "^2.18.1"
|
"mysql": "^2.18.1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user