fix: 修复消息阻塞

This commit is contained in:
tcmofashi
2025-03-29 00:52:53 +08:00
parent 19d2aaed52
commit df3a673a61

View File

@@ -48,7 +48,10 @@ class BaseMessageAPI:
while True:
if len(self.cache) > 0:
for handler in self.message_handlers:
await handler(self.cache[0])
try:
await handler(self.cache[0])
except:
pass
self.cache.pop(0)
if len(self.cache) > 0:
await asyncio.sleep(0.1 / len(self.cache))