Skip to content

Commit 8bdc7f9

Browse files
committed
fix: close db on exit
1 parent b87218f commit 8bdc7f9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/recordRequests.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ const crypto = require(`node:crypto`);
44
const SQLite3 = require(`better-sqlite3`);
55

66
const db = new SQLite3(path.join(__dirname, `nocks.db`));
7+
process.once(`exit`, () => {
8+
db.close();
9+
});
710

811
db.exec(`CREATE TABLE IF NOT EXISTS nocks (
912
hash BLOB PRIMARY KEY NOT NULL,

0 commit comments

Comments
 (0)