fix: initialize document processors in the ingest worker (PR #836 round-5)

🟡 The `worker` command never called initialize_document_processors(), so a
worker pod with ENABLE_UNSTRUCTURED/TESSERACT/CUSTOM configured silently ran
PyMuPDF-only (only the import-time-registered processor). The always-on API pod
registers them in its lifespan; the worker has its own startup path, so call
initialize_document_processors() there too (before run_worker_async).

🟢 Drop the unused get_database_url monkeypatch in the Postgres integration
fixture (build_app_for_url passes the URL explicitly; only the ssl lookup needs
pinning).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-06-03 15:52:33 +02:00
co-authored by Claude Opus 4.8
parent 704a537847
commit 5affbbcaa6
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -328,6 +328,14 @@ def worker(concurrency: int | None):
workers = concurrency or settings.vector_sync_processor_workers
app = get_procrastinate_app()
# Register the configured document processors (Unstructured / Tesseract /
# custom HTTP) in the worker process. The always-on API pod does this in its
# lifespan; the worker has its own startup path, so without this the worker
# would silently fall back to the import-time-registered PyMuPDF only.
from nextcloud_mcp_server.app import initialize_document_processors # noqa: PLC0415
initialize_document_processors()
async def _run() -> None:
# Open the connector pool once and reuse it for both the defensive
# schema apply (the always-on API pod is the authoritative applier) and