MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / wait_for_http

Function wait_for_http

start_webui.py:209–218  ·  view source on GitHub ↗
(url: str, timeout_seconds: int)

Source from the content-addressed store, hash-verified

207
208
209def wait_for_http(url: str, timeout_seconds: int) -> None:
210 deadline = time.time() + timeout_seconds
211 while time.time() < deadline:
212 try:
213 with urllib.request.urlopen(url, timeout=2) as response:
214 if response.status < 500:
215 return
216 except Exception:
217 time.sleep(1)
218 raise LaunchError(f"等待 Web UI 可访问超时: {url}")
219
220
221def maybe_open_browser(url: str, timeout_seconds: int, enabled: bool, dry_run: bool) -> threading.Thread | None:

Callers 1

_runnerFunction · 0.85

Calls 2

LaunchErrorClass · 0.85
sleepMethod · 0.80

Tested by

no test coverage detected