diff --git a/waku/persistence/store.go b/waku/persistence/store.go index 0e94ab24..975ba3e9 100644 --- a/waku/persistence/store.go +++ b/waku/persistence/store.go @@ -127,6 +127,12 @@ func (d *DBStore) cleanOlderRecords() error { } } + // reduce the size of the DB file after the delete operation. See: https://www.sqlite.org/lang_vacuum.html + _, err := d.db.Exec("VACUUM") + if err != nil { + return err + } + return nil }