From 2fa51533d539dc42e2eb8d473aa37ac7a11e88cd Mon Sep 17 00:00:00 2001 From: liuwei Date: Fri, 9 May 2025 09:49:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=87=AA=E5=8A=A8=E7=99=BB?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E8=87=AA=E5=8A=A8=E7=99=BB=E5=BD=95=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E5=B0=B1=E6=94=B9=E4=B8=80=E4=B8=8B=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robot.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/robot.py b/robot.py index e0fd4e4..60fa5be 100644 --- a/robot.py +++ b/robot.py @@ -310,8 +310,11 @@ class Robot(Job): self.LOG.debug("心跳进行中") else: self.LOG.warning("心跳失败") + self.LOG.error(f"wechat_ipad heartbeat heartbeat twice_auto_auth ") + self.login_twice_auto_auth() except Exception as e: self.LOG.error(f"wechat_ipad heartbeat: {e}") + self.login_twice_auto_auth() await asyncio.sleep(5) async def _heartbeat_task_long(self): @@ -324,13 +327,11 @@ class Robot(Job): self.LOG.debug("长连接心跳进行中") else: self.LOG.warning("长连接心跳失败") + self.LOG.error(f"wechat_ipad heartbeat long twice_auto_auth ") + self.login_twice_auto_auth() except Exception as e: self.LOG.error(f"wechat_ipad heartbeat long: {e}") - success = await self.ipad_bot.twice_auto_auth() - if success: - self.LOG.debug("尝试二次登录成功") - else: - self.LOG.warning("尝试二次登录失败") + self.login_twice_auto_auth() await asyncio.sleep(10) async def _process_ipad_message(self, message: WxMessage): @@ -592,6 +593,11 @@ class Robot(Job): resp = self.ipad_bot.twice_auto_auth() if resp: self.LOG.info(f"定时二次登录成功!") + if self.ipad_running: + self.LOG.info(f"ipad_wechat running:{self.ipad_running}") + else: + self.ipad_running = True + self.LOG.info(f"ipad_wechat stopped change running:{self.ipad_running}") else: self.LOG.error(f"定时二次登录失败!") except Exception as e: