diff --git a/nextcloud_mcp_server/cli.py b/nextcloud_mcp_server/cli.py index da29f1c7..a5b17257 100644 --- a/nextcloud_mcp_server/cli.py +++ b/nextcloud_mcp_server/cli.py @@ -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 diff --git a/tests/integration/test_ingest_queue_postgres.py b/tests/integration/test_ingest_queue_postgres.py index 6ac0027c..3ccedcad 100644 --- a/tests/integration/test_ingest_queue_postgres.py +++ b/tests/integration/test_ingest_queue_postgres.py @@ -78,8 +78,8 @@ async def fresh_app(postgres_url: str, monkeypatch: pytest.MonkeyPatch): finally: await engine.dispose() - # get_procrastinate_conninfo derives ssl from settings; point it at the URL. - monkeypatch.setattr(config_module, "get_database_url", lambda: postgres_url) + # build_app_for_url passes the URL explicitly to get_procrastinate_conninfo, + # so only the ssl lookup (which reads settings) needs pinning here. monkeypatch.setattr(config_module, "get_database_ssl", lambda: None) app = build_app_for_url(postgres_url)