Skip to content

Commit

Permalink
Feat: Flush WAL on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
chakflying committed Mar 22, 2023
1 parent 7231763 commit ca52047
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ca52047

Please sign in to comment.