Increase websocket messaging timeout (#4235)

* increase websocket timeout

* changelog
This commit is contained in:
Abubakar Abid 2023-05-16 14:10:00 -04:00 committed by GitHub
parent 8b72e9e127
commit 7241cdaf91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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:

View File

@ -514,14 +514,14 @@ class App(FastAPI):
# 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