INNER CODE UNIT · Python
wait_deadline
hi-godot/godot-ai · src/godot_ai/__init__.py:97
wait_deadline = time.monotonic() + wait_seconds
if wait_seconds > 0:
## Tell the plugin the bind loop is running before the first attempt:
## it kills the occupant only now, and a launch that took seconds to
## get here (uvx installing the new version) no longer leaves the
## port free for a bridge to spawn into.
from godot_ai.runtime_info import STARTUP_PHASE_WAITING_FOR_PORT, report_startup_phase
report_startup_phase(
STARTUP_PHASE_WAITING_FOR_PORT,
port=port,
label=label,
## The plugin names each launch; a phase from another launch's
## report must never pass for this one.
launch_id=os.environ.get(LAUNCH_ID_ENV, "").strip(),
)
while True:
sock = socket.socket(family, socket.SOCK_STREAM)