From 65898bab24cddd4bcc2e6fc3701d5b2a1d1d4986 Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 21 Jun 2023 17:39:40 +0800 Subject: [PATCH] fix #567 --- src/EdgeGPT/chathub.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/EdgeGPT/chathub.py b/src/EdgeGPT/chathub.py index e5ac22859..d0136021f 100644 --- a/src/EdgeGPT/chathub.py +++ b/src/EdgeGPT/chathub.py @@ -123,6 +123,8 @@ async def ask_stream( resp_txt_no_link = "" retry_count = 5 while True: + if wss.closed: + break msg = await wss.recv() if not msg: retry_count -= 1