修复:群聊图片发送后延迟1秒再发文字,确保消息顺序正确
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
- 卡片更新:按钮点击后更新卡片状态
|
- 卡片更新:按钮点击后更新卡片状态
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import asyncio
|
||||||
import httpx
|
import httpx
|
||||||
import time
|
import time
|
||||||
from typing import Optional, List, Dict
|
from typing import Optional, List, Dict
|
||||||
@@ -615,6 +616,9 @@ class WeChatService:
|
|||||||
if not sent:
|
if not sent:
|
||||||
success = False
|
success = False
|
||||||
logger.warning(f"群聊截图发送失败: alarm={alarm_id}")
|
logger.warning(f"群聊截图发送失败: alarm={alarm_id}")
|
||||||
|
else:
|
||||||
|
# 等待企微完成图片投递,避免后续文字消息先于图片到达
|
||||||
|
await asyncio.sleep(1)
|
||||||
else:
|
else:
|
||||||
logger.warning(f"截图上传企微失败,跳过图片消息: alarm={alarm_id}")
|
logger.warning(f"截图上传企微失败,跳过图片消息: alarm={alarm_id}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user