From 23b709f47cd23309de6c1027f4fa03a60eefb46a Mon Sep 17 00:00:00 2001 From: pushkala-datastax <75869456+pushkala-datastax@users.noreply.github.com> Date: Wed, 26 Nov 2025 17:33:38 -0800 Subject: [PATCH] Refactor document directory path retrieval Simplify document path handling by using openrag-documents for both Docker and local environments. --- src/main.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main.py b/src/main.py index 14c84e4d..35db1577 100644 --- a/src/main.py +++ b/src/main.py @@ -304,17 +304,14 @@ async def init_index_when_ready(): def _get_documents_dir(): """Get the documents directory path, handling both Docker and local environments.""" - # In Docker, the volume is mounted at /app/documents - # Locally, we use openrag-documents + # Always use openrag-documents regardless of environment + path = os.path.abspath(os.path.join(os.getcwd(), "openrag-documents")) container_env = detect_container_environment() if container_env: - path = os.path.abspath("/app/documents") - logger.debug(f"Running in {container_env}, using container path: {path}") - return path + logger.debug(f"Running in {container_env}, using path: {path}") else: - path = os.path.abspath(os.path.join(os.getcwd(), "openrag-documents")) - logger.debug(f"Running locally, using local path: {path}") - return path + logger.debug(f"Running locally, using path: {path}") + return path async def ingest_default_documents_when_ready(services):