INNER CODE UNIT · Python
check_server
runpod-workers/worker-comfyui · handler.py:262
def check_server(url, retries=0, delay=50):
"""
Check if a server is reachable via HTTP GET request.
When a PID file is available (written by start.sh), the function polls
indefinitely while the ComfyUI process is alive and fails immediately
when the process exits. When no PID file is found it falls back to
the retry limit for backward compatibility.
Args:
url (str): The URL to check.
retries (int): Max attempts. 0 means unlimited (poll while process alive).
delay (int): Time in milliseconds between retries.
Returns:
bool: True if the server is reachable, False otherwise.
"""
print(f"worker-comfyui - Checking API server at {url}...")