From f528a1c3951c9649eb87c9afc1aad3d9e89ac925 Mon Sep 17 00:00:00 2001 From: team2 Date: Tue, 17 Feb 2026 07:32:29 +0100 Subject: [PATCH] optimize chunk counter --- src/Ingest/IngestFlow.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Ingest/IngestFlow.php b/src/Ingest/IngestFlow.php index 8f158ba..21c74a6 100644 --- a/src/Ingest/IngestFlow.php +++ b/src/Ingest/IngestFlow.php @@ -80,19 +80,25 @@ final readonly class IngestFlow $this->chunkManager->appendChunks($records); $this->vectorBuilder->rebuildFromNdjson(); - $chunkCount = $this->chunkManager->countAllChunks(); - $this->metaManager->updateRuntimeStats($chunkCount); + $this->updateChuckCount(); } public function globalReindex(): void { $allRecords = $this->knowledgeIngestService->buildAllActiveChunkRecords(); - // Optional (wenn du willst): Hier könnte man ebenfalls ein Hard-Cap enforce'n (rewriteAll mit Limit). $this->chunkManager->rewriteAll($allRecords); $this->vectorBuilder->rebuildFromNdjson(); $this->metaManager->writeMetaForGlobalReindex(); + + $this->updateChuckCount(); + } + + private function updateChuckCount(): void + { + $chunkCount = $this->chunkManager->countAllChunks(); + $this->metaManager->updateRuntimeStats($chunkCount); } } \ No newline at end of file