From 21a9cb6866afe3354bee60d852ebffc7ef3a8355 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 25 Aug 2025 13:06:07 +0100 Subject: Insert new entities and log entry in a transaction If no new entities are required, no transaction is created. --- src/ingestor.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ingestor.hpp') diff --git a/src/ingestor.hpp b/src/ingestor.hpp index 7141515..040331f 100644 --- a/src/ingestor.hpp +++ b/src/ingestor.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace WebStat { class Ingestor { @@ -33,7 +34,10 @@ namespace WebStat { size_t linesDiscarded = 0; private: - template size_t storeEntities(const std::tuple &) const; + static constexpr size_t MAX_NEW_ENTITIES = 6; + void storeEntities(std::span>) const; + using NewEntities = std::array, MAX_NEW_ENTITIES>; + template NewEntities newEntities(const std::tuple &) const; mutable std::flat_set existingEntities; uint32_t hostnameId; -- cgit v1.2.3