Feat: Flush WAL on shutdown

This commit is contained in:
Nelson Chan 2023-02-15 15:30:28 +08:00
parent 72317633d9
commit ca52047bf5

View File

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