From c20c6bef33513094c423099ddc0cebb544a53b9b Mon Sep 17 00:00:00 2001 From: MarkLo Date: Fri, 21 Nov 2025 13:39:13 +0800 Subject: [PATCH] --- backend/app/core/config.py | 2 +- backend/app/main.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/app/core/config.py b/backend/app/core/config.py index 54c07674..1f079827 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -17,7 +17,7 @@ class Settings(BaseSettings): results_dir: str = Field(default="./results") # Redis configuration for task queue - redis_url: str = Field(default="redis://localhost:6379") + redis_url: str = Field(default="redis://localhost:6379", validation_alias="REDIS_URL") # API Keys openai_api_key: Optional[str] = None diff --git a/backend/app/main.py b/backend/app/main.py index 427c67e5..d453fb23 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -27,6 +27,17 @@ app = FastAPI( redoc_url="/redoc", ) +@app.on_event("startup") +async def startup_event(): + """Log configuration on startup""" + redis_url = settings.redis_url + # Mask password if present + if "@" in redis_url: + masked_url = redis_url.split("@")[1] + logger.info(f"Redis configured with host: {masked_url}") + else: + logger.info(f"Redis configured with URL: {redis_url}") + # Setup CORS setup_cors(app)