fix(maizone): 修复说说处理循环意外结束的潜在错误
为 `process_feeds_from_file` 方法添加了在循环意外结束后返回错误信息的逻辑,以防止函数在某些边缘情况下不返回值。 此外,移除了 `_process_comments` 方法中一个未使用的列表推导式。
This commit is contained in:
committed by
Windpicker-owo
parent
2f3922054a
commit
7ebc8453b8
@@ -215,6 +215,7 @@ class QZoneService:
|
||||
# 其他未知异常
|
||||
logger.error(f"读取和处理说说时发生异常: {e}", exc_info=True)
|
||||
return {"success": False, "message": f"处理说说时出现异常: {e}"}
|
||||
return {"success": False, "message": "读取和处理说说时发生未知错误,循环意外结束。"}
|
||||
|
||||
async def monitor_feeds(self, stream_id: str | None = None):
|
||||
"""监控并处理所有好友的动态,包括回复自己说说的评论"""
|
||||
@@ -319,8 +320,7 @@ class QZoneService:
|
||||
return
|
||||
|
||||
# 1. 将评论分为用户评论和自己的回复
|
||||
user_comments = [c for c in comments if str(c.get("qq_account")) != str(qq_account)]
|
||||
[c for c in comments if str(c.get("qq_account")) == str(qq_account)]
|
||||
user_comments = [c for c in comments if str(c.get("qq_account")) != str(qq_account)]
|
||||
|
||||
if not user_comments:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user