fix: use running loop for shell stream deadlines (#1694)

This commit is contained in:
Rolly Calma
2026-06-03 12:37:46 +08:00
committed by GitHub
parent 02ff2e3cb0
commit 933c461f38
2 changed files with 62 additions and 2 deletions
+3 -2
View File
@@ -125,10 +125,11 @@ class ShellService:
asyncio.create_task(_reader(proc.stderr, "stderr")),
]
loop = asyncio.get_running_loop()
finished = 0
deadline = asyncio.get_event_loop().time() + timeout
deadline = loop.time() + timeout
while finished < 2:
remaining = deadline - asyncio.get_event_loop().time()
remaining = deadline - loop.time()
if remaining <= 0:
raise asyncio.TimeoutError()