diff --git a/server/database.js b/server/database.js index 8576bdedc..93f734cb0 100644 --- a/server/database.js +++ b/server/database.js @@ -417,6 +417,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();