diff options
Diffstat (limited to 'src/ingestor.cpp')
| -rw-r--r-- | src/ingestor.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ingestor.cpp b/src/ingestor.cpp index 3e36d85..fe8d38c 100644 --- a/src/ingestor.cpp +++ b/src/ingestor.cpp @@ -562,8 +562,10 @@ namespace WebStat { assert(!entity.id); const auto & [typeName, onInsert] = ENTITY_TYPE_VALUES[std::to_underlying(entity.type)]; - entity.id = insert(dbconn, SQL::ENTITY_INSERT, SQL::ENTITY_INSERT_OPTS, entity.value, typeName); - if (onInsert) { + bool entityNullDetail = true; + std::tie(entity.id, entityNullDetail) + = insert<EntityId, bool>(dbconn, SQL::ENTITY_INSERT, SQL::ENTITY_INSERT_OPTS, entity.value, typeName); + if (onInsert && entityNullDetail) { std::invoke(onInsert, this, entity); } stats.entitiesInserted += 1; |
