From aa35ea98a3cfc77de6510fdee638b789169a6455 Mon Sep 17 00:00:00 2001 From: helloplhm-qwq Date: Fri, 5 Jan 2024 18:09:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=9C=A8=E5=BF=AB=E9=80=9F=E5=90=AF=E5=8A=A8=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E6=97=B6=E6=8A=A5=E5=87=BA=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/lx_script.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/lx_script.py b/common/lx_script.py index dddd167..d0e96e9 100644 --- a/common/lx_script.py +++ b/common/lx_script.py @@ -28,7 +28,11 @@ async def get_response(retry = 0): req = await Httpx.AsyncRequest('https://mirror.ghproxy.com/' + baseurl) else: req = await Httpx.AsyncRequest(baseurl) - except: + except Exception as e: + if (isinstance(e, RuntimeError)): + if ('Session is closed' in str(e)): + logger.error('脚本更新失败,clientSession已被关闭') + return return await get_response(retry + 1) return req