Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
9 changes: 6 additions & 3 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down