From 3722a164b6fcbbe233795054e41cafbd6d77c6b9 Mon Sep 17 00:00:00 2001 From: liuwei Date: Fri, 16 May 2025 09:13:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=BC=82=E5=B8=B8=E6=8D=95?= =?UTF-8?q?=E8=8E=B7=EF=BC=8C=E9=98=B2=E6=AD=A2=E9=80=80=E5=87=BA=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/robot.py b/robot.py index 87962f3..ebf1f99 100644 --- a/robot.py +++ b/robot.py @@ -233,7 +233,11 @@ class Robot(Job): except Exception as e: self.LOG.error(f"WxMessage.from_json 解析失败,消息内容: {message},错误: {e}") continue # 跳过本条消息,继续处理下一条 - await self._process_ipad_message(wxmsg) + try: + await self._process_ipad_message(wxmsg) + except Exception as e: + self.LOG.error(f"捕获消息处理异常,继续进行下一个消息处理{e}") + continue # 跳过本条消息,继续处理下一条 # 使用异步睡眠替代忙等待循环 await asyncio.sleep(0.5)