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:
parent
6b2b0738cb
commit
4d0360d94a
@ -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"
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user