From bc42df247274acd0f52f37cf6dbc5b58f71dedfa Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Wed, 4 Oct 2023 16:35:35 +0800 Subject: [PATCH] =?UTF-8?q?F=20|=20=E5=B0=9D=E8=AF=95=E5=9C=A8=E6=96=B0?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E9=87=8C=E8=B7=91=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connect.py b/connect.py index c631182..304d070 100644 --- a/connect.py +++ b/connect.py @@ -189,7 +189,7 @@ async def add_message(data: Dict[str, Any]): evals: str = data.get('message').get('content')[2:] try: - result = await asyncio.wait_for(safe_eval(evals), 5) + result = await asyncio.gather(asyncio.to_thread(safe_eval, evals)) except asyncio.TimeoutError: result = f'{evals}\n超时' reply = ReplyMessage(id=data['message']['_id'])