mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00:00 
			
		
		
		
	tidy up mysql some more
remove listeners on close and update status on partial deploy
This commit is contained in:
		| @@ -56,9 +56,9 @@ module.exports = function(RED) { | ||||
|         } | ||||
|  | ||||
|         this.connect = function() { | ||||
|             if (!this.connected && !this.connecting) { | ||||
|                 doConnect(); | ||||
|             } | ||||
|             if (!this.connected && !this.connecting) { doConnect(); } | ||||
|             if (this.connected) { node.emit("state","connected"); } | ||||
|             else { node.emit("state","connecting"); } | ||||
|         } | ||||
|  | ||||
|         this.on('close', function (done) { | ||||
| @@ -127,6 +127,11 @@ module.exports = function(RED) { | ||||
|                     node.status({fill:"red",shape:"ring",text:"not yet connected"}); | ||||
|                 } | ||||
|             }); | ||||
|  | ||||
|             node.on('close', function () { | ||||
|                 node.mydbConfig.removeAllListeners(); | ||||
|                 node.status({}); | ||||
|             }); | ||||
|         } | ||||
|         else { | ||||
|             this.error("MySQL database not configured"); | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|     "name"          : "node-red-node-mysql", | ||||
|     "version"       : "0.0.12", | ||||
|     "version"       : "0.0.13", | ||||
|     "description"   : "A Node-RED node to read and write to a MySQL database", | ||||
|     "dependencies"  : { | ||||
|         "mysql"   : "^2.12.0" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user