mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
mysql - slightly overzealous closing of connections - causes crash. backed off slightly
This commit is contained in:
parent
705dd1ffc1
commit
fa8e174d0b
@ -19,8 +19,8 @@ module.exports = function(RED) {
|
|||||||
|
|
||||||
function checkVer() {
|
function checkVer() {
|
||||||
node.connection.query("SELECT version();", [], function(err, rows) {
|
node.connection.query("SELECT version();", [], function(err, rows) {
|
||||||
node.connection.release();
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
node.connection.release();
|
||||||
node.error(err);
|
node.error(err);
|
||||||
node.status({fill:"red",shape:"ring",text:"Bad Ping"});
|
node.status({fill:"red",shape:"ring",text:"Bad Ping"});
|
||||||
doConnect();
|
doConnect();
|
||||||
@ -103,6 +103,7 @@ module.exports = function(RED) {
|
|||||||
RED.nodes.createNode(this,n);
|
RED.nodes.createNode(this,n);
|
||||||
this.mydb = n.mydb;
|
this.mydb = n.mydb;
|
||||||
this.mydbConfig = RED.nodes.getNode(this.mydb);
|
this.mydbConfig = RED.nodes.getNode(this.mydb);
|
||||||
|
this.status({});
|
||||||
|
|
||||||
if (this.mydbConfig) {
|
if (this.mydbConfig) {
|
||||||
this.mydbConfig.connect();
|
this.mydbConfig.connect();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-mysql",
|
"name": "node-red-node-mysql",
|
||||||
"version": "0.0.21",
|
"version": "0.0.22",
|
||||||
"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…
Reference in New Issue
Block a user