🤖 自动格式化代码 [skip ci]

This commit is contained in:
github-actions[bot]
2025-04-20 09:25:10 +00:00
parent ed21af9dba
commit 53abdabccd
5 changed files with 87 additions and 82 deletions

View File

@@ -184,9 +184,7 @@ class ChattingObservation(Observation):
try:
# 只需检查是否存在,不需要获取内容,使用 {"_id": 1} 提高效率
new_message = await asyncio.to_thread(
db.messages.find_one,
{"chat_id": self.chat_id, "time": {"$gt": timestamp}},
{"_id": 1}
db.messages.find_one, {"chat_id": self.chat_id, "time": {"$gt": timestamp}}, {"_id": 1}
)
# new_message = db.messages.find_one({"chat_id": self.chat_id, "time": {"$gt": timestamp}}, {"_id": 1}) # find_one 不是异步的
return new_message is not None