fix: dynamic timeout for tv_key with times > 1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
02070b7f02
commit
66bb08b683
3
main.py
3
main.py
|
|
@ -107,7 +107,8 @@ async def tv_key(key: str, times: int = 1) -> dict[str, Any]:
|
||||||
def _do():
|
def _do():
|
||||||
_tv.send_key(key, times)
|
_tv.send_key(key, times)
|
||||||
return _ok(f"Sent {key} x{times}")
|
return _ok(f"Sent {key} x{times}")
|
||||||
return await _safe(_do)
|
t = max(TOOL_TIMEOUT, times * 0.3 + 5)
|
||||||
|
return await _safe(_do, timeout=t)
|
||||||
|
|
||||||
|
|
||||||
@mcp.tool()
|
@mcp.tool()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue