GC improvements

This commit is contained in:
Doug Hoyte
2023-01-29 15:52:27 -05:00
parent ee612416e0
commit 5117485ebf
7 changed files with 62 additions and 26 deletions

View File

@ -1,5 +1,7 @@
#include "RelayServer.h"
#include "gc.h"
void RelayServer::cleanupOldEvents() {
std::vector<uint64_t> expiredLevIds;
@ -63,3 +65,14 @@ void RelayServer::cleanupOldEvents() {
if (numDeleted) LI << "Deleted " << numDeleted << " ephemeral events";
}
}
void RelayServer::garbageCollect() {
quadrable::Quadrable qdb;
{
auto txn = env.txn_ro();
qdb.init(txn);
}
qdb.checkout("events");
quadrableGarbageCollect(qdb, 1);
}