Skip to content

Commit b7f6f71

Browse files
committed
fix: close db on exit
1 parent ba2ca74 commit b7f6f71

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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)