mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-14 17:04:53 +00:00
deploy: a9c31b4b531c16f9f5fac0a51c51dc5715e7ca2e
This commit is contained in:
parent
ba35420262
commit
112f1b2d8c
@ -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,
|
||||
|
@ -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] =
|
||||
|
Loading…
x
Reference in New Issue
Block a user