去除堆积消息丢弃策略
This commit is contained in:
28
robot.py
28
robot.py
@@ -191,20 +191,20 @@ class Robot(Job):
|
|||||||
self.LOG.info("处理堆积消息中")
|
self.LOG.info("处理堆积消息中")
|
||||||
|
|
||||||
await self.ipad_bot.send_text_message("filehelper", "ipad客户端启动成功")
|
await self.ipad_bot.send_text_message("filehelper", "ipad客户端启动成功")
|
||||||
count = 0
|
# count = 0
|
||||||
while True:
|
# while True:
|
||||||
data = await self.ipad_bot.sync_message()
|
# data = await self.ipad_bot.sync_message()
|
||||||
data = data.get("AddMsgs")
|
# data = data.get("AddMsgs")
|
||||||
if not data:
|
# if not data:
|
||||||
if count > 2:
|
# if count > 2:
|
||||||
break
|
# break
|
||||||
else:
|
# else:
|
||||||
count += 1
|
# count += 1
|
||||||
continue
|
# continue
|
||||||
|
#
|
||||||
self.LOG.debug(f"接受到 {len(data)} 条消息")
|
# self.LOG.debug(f"接受到 {len(data)} 条消息")
|
||||||
await asyncio.sleep(1)
|
# await asyncio.sleep(1)
|
||||||
self.LOG.info("处理堆积消息完毕")
|
# self.LOG.info("处理堆积消息完毕")
|
||||||
|
|
||||||
# 标记为运行中
|
# 标记为运行中
|
||||||
self.ipad_running = True
|
self.ipad_running = True
|
||||||
|
|||||||
Reference in New Issue
Block a user