1234567891011121314151617 |
- import time
- import os
- bind = '0.0.0.0:8349'
- workers = os.environ.get("WORKERS", "2")
- timeout = os.environ.get("TIMEOUT", "180")
- preload_app = True
- def on_starting(server):
- worker_count = int(workers)
- # Insert a 2-second gap between workers
- gap_duration = 2
- for i in range(worker_count):
- # Add a delay between each worker
- time.sleep(gap_duration)
- print(f"Starting worker {i + 1}/{worker_count}")
|