diff --git a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool index 5d8dfb9a0..41dc9c0e5 100755 --- a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool +++ b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool @@ -2,7 +2,7 @@ # libtool - Provide generalized library-building support services. # Generated automatically by config.status (libbacktrace) version-unused -# Libtool was configured on host fv-az447-29: +# Libtool was configured on host fv-az449-108: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, diff --git a/waku/v2/node/storage/message/waku_message_store.nim b/waku/v2/node/storage/message/waku_message_store.nim index 114f84252..b0f433588 100644 --- a/waku/v2/node/storage/message/waku_message_store.nim +++ b/waku/v2/node/storage/message/waku_message_store.nim @@ -63,6 +63,11 @@ proc deleteOldest(db: WakuMessageStore): MessageStoreResult[void] = let numMessages = messageCount(db.database).get() # requires another SELECT query, so only run in debug mode debug "Oldest messages deleted from DB due to overflow.", storeCapacity=db.storeCapacity, maxStore=db.storeMaxLoad, deleteWindow=db.deleteWindow, messagesLeft=numMessages + # reduce the size of the DB file after the delete operation. See: https://www.sqlite.org/lang_vacuum.html + let resVacuum = db.database.query("vacuum", proc(s: ptr sqlite3_stmt) = discard) + if resVacuum.isErr: + return err("vacuum after delete was not successful: " & resVacuum.error) + ok() proc init*(T: type WakuMessageStore, db: SqliteDatabase, storeCapacity: int = 50000): MessageStoreResult[T] =