mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Improve Interruption Handling (#134)
* Clear websocket queue on interrupt * add code
This commit is contained in:
@@ -509,7 +509,7 @@ class Stream(WebRTCConnectionMixin):
|
||||
handler.phone_mode = True
|
||||
|
||||
async def set_handler(s: str, a: WebSocketHandler):
|
||||
if len(self.connections) >= self.concurrency_limit:
|
||||
if len(self.connections) >= self.concurrency_limit: # type: ignore
|
||||
await cast(WebSocket, a.websocket).send_json(
|
||||
{
|
||||
"status": "failed",
|
||||
@@ -532,7 +532,7 @@ class Stream(WebRTCConnectionMixin):
|
||||
handler.phone_mode = False
|
||||
|
||||
async def set_handler(s: str, a: WebSocketHandler):
|
||||
if len(self.connections) >= self.concurrency_limit:
|
||||
if len(self.connections) >= self.concurrency_limit: # type: ignore
|
||||
await cast(WebSocket, a.websocket).send_json(
|
||||
{
|
||||
"status": "failed",
|
||||
|
||||
Reference in New Issue
Block a user