diff --git a/server/database.js b/server/database.js index e52ae8bfc..8a088c941 100644 --- a/server/database.js +++ b/server/database.js @@ -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();