This commit is contained in:
MarkLo 2025-11-21 13:39:13 +08:00
parent 2a188004c1
commit c20c6bef33
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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)