diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-08-23 19:26:59 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-08-25 16:02:44 +0100 |
commit | e30cbf9fef8922abef4cc44ad8628d4eef5d28a9 (patch) | |
tree | fce01562e2743bda9b0095ec2b7fd08ed77e9e38 /src/ingestor.cpp | |
parent | a84be46d879ad3bde0e4a0890ef1108bf5e10b0b (diff) | |
download | webstat-e30cbf9fef8922abef4cc44ad8628d4eef5d28a9.tar.bz2 webstat-e30cbf9fef8922abef4cc44ad8628d4eef5d28a9.tar.xz webstat-e30cbf9fef8922abef4cc44ad8628d4eef5d28a9.zip |
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.
Diffstat (limited to 'src/ingestor.cpp')
-rw-r--r-- | src/ingestor.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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; } |