diff --git a/src/config.py b/src/config.py index 85270c2..8a939e5 100644 --- a/src/config.py +++ b/src/config.py @@ -82,8 +82,10 @@ # --- Validation --- -if not all([DB_USER, DB_PASSWORD]): - logger.error("Database credentials (DB_USER, DB_PASSWORD) not found in environment variables or .env file.") +if not DB_USER: + logger.error("DB_USER is empty or missing from the environment or .env file.") +if DB_PASSWORD is None: + logger.error("DB_PASSWORD is missing from the environment or .env file.") # Embedding Provider and Keys logger.info(f"Selected Embedding Provider: {EMBEDDING_PROVIDER}") diff --git a/src/server.py b/src/server.py index 7b18e66..27735a4 100644 --- a/src/server.py +++ b/src/server.py @@ -68,9 +68,12 @@ async def create_vector_store(self, database_name: str, vector_store_name: str, async def initialize_pool(self): """Initializes the asyncmy connection pool within the running event loop.""" - if not all([DB_USER, DB_PASSWORD]): - logger.error("Cannot initialize pool due to missing database credentials.") - raise ConnectionError("Missing database credentials for pool initialization.") + if not DB_USER: + logger.error("Cannot initialize pool: DB_USER is empty or missing") + raise ConnectionError("Missing DB_USER for pool initialization.") + if DB_PASSWORD is None: + logger.error("Cannot initialize pool: DB_PASSWORD is missing") + raise ConnectionError("Missing DB_PASSWORD for pool initialization.") if self.pool is not None: logger.info("Connection pool already initialized.")