gunicorn.conf.py 525 B

12345678910111213141516171819202122
  1. import time
  2. import os
  3. bind = '0.0.0.0:8349'
  4. workers = os.environ.get("WORKERS", "2")
  5. timeout = os.environ.get("TIMEOUT", "180")
  6. preload_app = True
  7. enable_stdio_inheritance = True
  8. loglevel = 'debug'
  9. accesslog = '-'
  10. pidfile = "app.pid"
  11. def on_starting(server):
  12. worker_count = int(workers)
  13. # Insert a 1-second gap between workers
  14. gap_duration = 1
  15. for i in range(worker_count):
  16. # Add a delay between each worker
  17. time.sleep(gap_duration)
  18. print(f"Starting worker {i + 1}/{worker_count}")