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 committed May 16, 2023
1 parent 8b72e9e commit 7241cda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -17,6 +17,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
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 7241cda

Please sign in to comment.