Skip to content

Commit

Permalink
Increase websocket messaging timeout (#4235)
Browse files Browse the repository at this point in the history
* increase websocket timeout

* changelog
  • Loading branch information
abidlabs authored and dawoodkhan82 committed Jun 2, 2023
1 parent c095cf7 commit 858f202
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

- Update the js client by [@pngwn](https://github.com/pngwn) in [PR 3899](https://github.com/gradio-app/gradio/pull/3899)
- Fix documentation for the shape of the numpy array produced by the `Image` component by [@der3318](https://github.com/der3318) in [PR 4204](https://github.com/gradio-app/gradio/pull/4204).
- Updates the timeout for websocket messaging from 1 second to 5 seconds by [@abidlabs](https://github.com/abidlabs) in [PR 4235](https://github.com/gradio-app/gradio/pull/4235)


## Breaking Changes:

Expand Down
4 changes: 2 additions & 2 deletions gradio/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,14 +514,14 @@ async def join_queue(
# to create a unique id for each job
try:
await asyncio.wait_for(
websocket.send_json({"msg": "send_hash"}), timeout=1
websocket.send_json({"msg": "send_hash"}), timeout=5
)
except AsyncTimeOutError:
return

try:
session_info = await asyncio.wait_for(
websocket.receive_json(), timeout=1
websocket.receive_json(), timeout=5
)
except AsyncTimeOutError:
return
Expand Down

0 comments on commit 858f202

Please sign in to comment.