INNER CODE UNIT · Python
_command_timeout
deeplethe/forkd · sdk/mcp/sandstorm_mcp/server.py:82
def _command_timeout(timeout_secs: float) -> float:
"""How long to wait for a command the sandbox may run for this long.
The master gives the node timeout_secs plus 20 s and then answers 504, so
waiting a little longer gets its answer rather than our own.
"""
return timeout_secs + 25
def _wait_until_running(c: httpx.Client, sandbox_id: str, deadline: float) -> dict[str, Any]:
"""Block until a node reports this sandbox running, and return it.
The master answers a create before any node has acted on it, and an exec
that arrives first fails. A node reports the address only for a sandbox
with processes, so that is the signal. ping is not: its ok also needs
something listening inside.
"""
pause = 0.05