From e30cbf9fef8922abef4cc44ad8628d4eef5d28a9 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 23 Aug 2025 19:26:59 +0100 Subject: Track existing entities, don't attempt reinsert This is an ever growing set, but in theory should be finite, and is only 4bytes per entity. --- src/ingestor.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ingestor.cpp') diff --git a/src/ingestor.cpp b/src/ingestor.cpp index e316e84..8547745 100644 --- a/src/ingestor.cpp +++ b/src/ingestor.cpp @@ -121,10 +121,14 @@ namespace WebStat { size_t Ingestor::storeEntity(const Entity entity) const { + if (existingEntities.contains(entity.first)) { + return 0; + } auto insert = dbconn->modify(SQL::ENTITY_INSERT, SQL::ENTITY_INSERT_OPTS); insert->bindParamI(0, entity.first); insert->bindParamS(1, entity.second); insert->execute(); + existingEntities.emplace(entity.first); return 1; } -- cgit v1.2.3