123456789101112131415161718192021222324252627 |
- import time
- import os
- bind = '0.0.0.0:8348'
- workers = os.environ.get("WORKERS", "2")
- timeout = os.environ.get("TIMEOUT", "180")
- preload_app = True
- enable_stdio_inheritance = True
- loglevel = 'info'
- accesslog = '-'
- pidfile = "app.pid"
- keyfile = None
- certfile = None
- worker_class = 'gthread'
- threads = 4
- ca_certs = None
- def on_starting(server):
- worker_count = int(workers)
- # Insert a 1-second gap between workers
- gap_duration = 1
- for i in range(worker_count):
- # Add a delay between each worker
- time.sleep(gap_duration)
- print(f"Starting worker {i + 1}/{worker_count}")
|