Feat: Flush WAL on shutdown

This commit is contained in:
Nelson Chan 2023-02-15 15:30:28 +08:00
parent 72317633d9
commit ca52047bf5
1 changed files with 3 additions and 0 deletions

View File

@ -434,6 +434,9 @@ class Database {
log.info("db", "Closing the database");
// Flush WAL to main database
await R.exec("PRAGMA wal_checkpoint(TRUNCATE)");
while (true) {
Database.noReject = true;
await R.close();