| 12345678910111213141516171819202122232425 |
- """Gunicorn configuration for DataOps Platform production."""
- import os
- bind = f"{os.environ.get('LISTEN_HOST', '0.0.0.0')}:{os.environ.get('LISTEN_PORT', '5500')}"
- workers = int(os.environ.get("GUNICORN_WORKERS", "4"))
- timeout = int(os.environ.get("GUNICORN_TIMEOUT", "120"))
- capture_output = True
- enable_stdio_inheritance = True
- loglevel = "info"
- def post_worker_init(worker):
- """Re-apply Flask file logging after Gunicorn worker initialization."""
- del worker
- try:
- from wsgi import application
- from app import configure_logging
- configure_logging(application)
- except Exception as exc:
- import sys
- print(f"[gunicorn] post_worker_init logging setup failed: {exc}", file=sys.stderr)
|