mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Mysql fix (#886)
* Check if there is a connection before release Fixes #885
This commit is contained in:
parent
5c333db0dd
commit
87e50f2b76
@ -114,7 +114,9 @@ module.exports = function(RED) {
|
|||||||
//console.log("query:",msg.topic);
|
//console.log("query:",msg.topic);
|
||||||
node.mydbConfig.pool.getConnection(function (err, conn) {
|
node.mydbConfig.pool.getConnection(function (err, conn) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
if (conn) {
|
||||||
conn.release()
|
conn.release()
|
||||||
|
}
|
||||||
status = { fill: "red", shape: "ring", text: RED._("mysql.status.error") + ": " + err.code };
|
status = { fill: "red", shape: "ring", text: RED._("mysql.status.error") + ": " + err.code };
|
||||||
node.status(status);
|
node.status(status);
|
||||||
node.error(err, msg);
|
node.error(err, msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user