1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

add done to sqlite close

This commit is contained in:
Dave Conway-Jones 2018-05-30 11:17:15 +01:00
parent 6b2b0738cb
commit 4d0360d94a
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-node-sqlite", "name": "node-red-node-sqlite",
"version": "0.2.2", "version": "0.2.3",
"description": "A sqlite node for Node-RED", "description": "A sqlite node for Node-RED",
"dependencies": { "dependencies": {
"sqlite3": "^4.0.0" "sqlite3": "^4.0.0"

View File

@ -21,9 +21,10 @@ module.exports = function(RED) {
}); });
} }
node.on('close', function () { node.on('close', function (done) {
if (node.tick) { clearTimeout(node.tick); } if (node.tick) { clearTimeout(node.tick); }
if (node.db) { node.db.close(); } if (node.db) { node.db.close(done()); }
else { done(); }
}); });
} }
RED.nodes.registerType("sqlitedb",SqliteNodeDB); RED.nodes.registerType("sqlitedb",SqliteNodeDB);