Enhance gunicorn config handling with env vars and command line arg priority

• Add env var support for timeout/keepalive
• Prioritize CLI args over env vars
• Standardize default timeout to 150s
This commit is contained in:
yangdx
2025-03-01 12:58:52 +08:00
parent 35bcfca28f
commit 48d9800573
2 changed files with 22 additions and 16 deletions

View File

@@ -26,8 +26,8 @@ preload_app = True
worker_class = "uvicorn.workers.UvicornWorker"
# Other Gunicorn configurations
timeout = int(os.getenv("TIMEOUT", 120))
keepalive = 5
timeout = int(os.getenv("TIMEOUT", 150)) # Default 150s to match run_with_gunicorn.py
keepalive = int(os.getenv("KEEPALIVE", 5)) # Default 5s
# Logging configuration
errorlog = os.getenv("ERROR_LOG", log_file_path) # Default write to lightrag.log