Skip to content

Commit

Permalink
3.11 incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
freddyaboulton committed Mar 29, 2024
1 parent 93aaa06 commit 0193c96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gradio/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,11 @@ async def iterator():
yield "data: ALIVE\n\n"
# We need to close the heartbeat connections as soon as the server stops
# otherwise the server can take forever to close
wait_task = asyncio.create_task(wait())
stop_stream_task = asyncio.create_task(stop_stream())
done, _ = await asyncio.wait(
[wait(), stop_stream()], return_when=asyncio.FIRST_COMPLETED
[wait_task, stop_stream_task],
return_when=asyncio.FIRST_COMPLETED,
)
done = [d.result() for d in done]
if "stop" in done:
Expand Down

0 comments on commit 0193c96

Please sign in to comment.