optimize chunk counter
This commit is contained in:
@@ -80,19 +80,25 @@ final readonly class IngestFlow
|
|||||||
$this->chunkManager->appendChunks($records);
|
$this->chunkManager->appendChunks($records);
|
||||||
$this->vectorBuilder->rebuildFromNdjson();
|
$this->vectorBuilder->rebuildFromNdjson();
|
||||||
|
|
||||||
$chunkCount = $this->chunkManager->countAllChunks();
|
$this->updateChuckCount();
|
||||||
$this->metaManager->updateRuntimeStats($chunkCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function globalReindex(): void
|
public function globalReindex(): void
|
||||||
{
|
{
|
||||||
$allRecords = $this->knowledgeIngestService->buildAllActiveChunkRecords();
|
$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->chunkManager->rewriteAll($allRecords);
|
||||||
|
|
||||||
$this->vectorBuilder->rebuildFromNdjson();
|
$this->vectorBuilder->rebuildFromNdjson();
|
||||||
|
|
||||||
$this->metaManager->writeMetaForGlobalReindex();
|
$this->metaManager->writeMetaForGlobalReindex();
|
||||||
|
|
||||||
|
$this->updateChuckCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function updateChuckCount(): void
|
||||||
|
{
|
||||||
|
$chunkCount = $this->chunkManager->countAllChunks();
|
||||||
|
$this->metaManager->updateRuntimeStats($chunkCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user