phase a audit
This commit is contained in:
@@ -49,9 +49,8 @@ final class VectorIndexBuilder
|
||||
// --------------------------------------------
|
||||
// 🔵 FALL: NDJSON ist leer → kein Vector Index
|
||||
// --------------------------------------------
|
||||
if (filesize($this->indexNdjsonPath) === 0) {
|
||||
if (!is_file($this->indexNdjsonPath) || filesize($this->indexNdjsonPath) === 0) {
|
||||
|
||||
// Alten Index entfernen
|
||||
@unlink($this->vectorIndexPath);
|
||||
@unlink($this->vectorMetaPath);
|
||||
|
||||
@@ -63,7 +62,7 @@ final class VectorIndexBuilder
|
||||
);
|
||||
}
|
||||
|
||||
return; // WICHTIG: kein Python, kein tmp, kein Fehler
|
||||
return;
|
||||
}
|
||||
|
||||
// --------------------------------------------
|
||||
@@ -79,7 +78,6 @@ final class VectorIndexBuilder
|
||||
|
||||
$tmpVectorIndexPath = $this->vectorIndexPath . '.tmp';
|
||||
|
||||
// Clean leftovers
|
||||
@unlink($tmpVectorIndexPath);
|
||||
@unlink($this->vectorMetaPath);
|
||||
|
||||
@@ -108,11 +106,15 @@ final class VectorIndexBuilder
|
||||
private function assertPreconditions(): void
|
||||
{
|
||||
if (!is_file($this->scriptPath)) {
|
||||
throw new \RuntimeException('vector_ingest.py not found at: ' . $this->scriptPath);
|
||||
throw new \RuntimeException(
|
||||
'Vector build script not found at: ' . $this->scriptPath
|
||||
);
|
||||
}
|
||||
|
||||
if (!is_file($this->indexNdjsonPath)) {
|
||||
throw new \RuntimeException('index.ndjson not found at: ' . $this->indexNdjsonPath);
|
||||
throw new \RuntimeException(
|
||||
'index.ndjson not found at: ' . $this->indexNdjsonPath
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,4 +197,4 @@ final class VectorIndexBuilder
|
||||
@file_put_contents($logPath, "=== VectorIndexBuilder OK ===\n", FILE_APPEND);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user