调整chrome内容
This commit is contained in:
15
robot.py
15
robot.py
@@ -183,6 +183,7 @@ class Robot(Job):
|
||||
|
||||
# 开启自动心跳(作为后台任务)
|
||||
heartbeat_task = asyncio.create_task(self._heartbeat_task())
|
||||
heartbeat_task_long = asyncio.create_task(self._heartbeat_task_long())
|
||||
self.message_storage = MessageStorage(self.ipad_bot)
|
||||
|
||||
# 初始化消息工具类 - 使用联系人管理器
|
||||
@@ -308,6 +309,20 @@ class Robot(Job):
|
||||
self.LOG.error(f"wechat_ipad heartbeat: {e}")
|
||||
await asyncio.sleep(5)
|
||||
|
||||
async def _heartbeat_task_long(self):
|
||||
"""wechat_ipad心跳任务"""
|
||||
self.LOG.info("开启wechat_ipad长连接心跳!")
|
||||
while self.ipad_running:
|
||||
try:
|
||||
success = await self.ipad_bot.heartbeat_long()
|
||||
if success:
|
||||
self.LOG.success("长连接心跳进行中")
|
||||
else:
|
||||
self.LOG.warning("长连接心跳失败")
|
||||
except Exception as e:
|
||||
self.LOG.error(f"wechat_ipad heartbeat long: {e}")
|
||||
await asyncio.sleep(5)
|
||||
|
||||
async def _process_ipad_message(self, message: WxMessage):
|
||||
"""处理wechat_ipad消息"""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user