From 14d7f3b2b90b92e9763280b3fb243b5bf30c1ae9 Mon Sep 17 00:00:00 2001 From: team2 Date: Thu, 12 Feb 2026 18:56:15 +0100 Subject: [PATCH] optimize first system installation and fix migrations --- .gitignore | 2 +- config/services.yaml | 2 +- migrations/Version20260211145121.php | 33 ---------------------------- src/Service/IngestOrchestrator.php | 4 +++- 4 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 migrations/Version20260211145121.php diff --git a/.gitignore b/.gitignore index ad15f48..898a8ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .ddev .idea /var/knowledge -/src/Vector/.venv +/.venv /src/Vector/vector.index /src/Vector/vector_meta.json /var/locks diff --git a/config/services.yaml b/config/services.yaml index 8f933e1..26cfab6 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -9,7 +9,7 @@ parameters: mto.index.embedding_dimension: 768 mto.index.scoring_version: 1 - mto.vector.python_bin: '/var/www/html/src/Vector/.venv/bin/python' + mto.vector.python_bin: '/var/www/html/.venv/bin/python3' mto.vector.ingest_script: '/src/Vector/vector_ingest.py' mto.vector.timeout: 600 diff --git a/migrations/Version20260211145121.php b/migrations/Version20260211145121.php deleted file mode 100644 index 3d71b3a..0000000 --- a/migrations/Version20260211145121.php +++ /dev/null @@ -1,33 +0,0 @@ -addSql('CREATE TABLE ingest_job (id BINARY(16) NOT NULL, type VARCHAR(30) NOT NULL, status VARCHAR(20) NOT NULL, document_id VARCHAR(255) DEFAULT NULL, document_version_id VARCHAR(255) DEFAULT NULL, started_at DATETIME NOT NULL, finished_at DATETIME DEFAULT NULL, log_path VARCHAR(255) DEFAULT NULL, error_message LONGTEXT DEFAULT NULL, started_by_id BINARY(16) DEFAULT NULL, INDEX IDX_4F6AC8649740C9D5 (started_by_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4'); - $this->addSql('ALTER TABLE ingest_job ADD CONSTRAINT FK_4F6AC8649740C9D5 FOREIGN KEY (started_by_id) REFERENCES user (id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE ingest_job DROP FOREIGN KEY FK_4F6AC8649740C9D5'); - $this->addSql('DROP TABLE ingest_job'); - } -} diff --git a/src/Service/IngestOrchestrator.php b/src/Service/IngestOrchestrator.php index 680172d..d286ed9 100644 --- a/src/Service/IngestOrchestrator.php +++ b/src/Service/IngestOrchestrator.php @@ -20,6 +20,7 @@ final class IngestOrchestrator /** * Startet Ingest für eine bestimmte DocumentVersion (1 Job pro Run). + * @throws \Throwable */ public function runForVersion( DocumentVersion $version, @@ -58,7 +59,7 @@ final class IngestOrchestrator usleep(200000); } else { // Fachlogik ausführen (Flow erzeugt keine Jobs!) - $this->ingestFlow->ingestDocumentVersion($version, $job->getLogPath()); + $this->ingestFlow->ingestDocumentVersion($version); } // Erfolg @@ -69,6 +70,7 @@ final class IngestOrchestrator return $job; } catch (\Throwable $e) { + if ($job) { $this->jobService->markFailed($job, $e->getMessage()); }