fix: 修复消息阻塞
This commit is contained in:
1 parent
19d2aaed52
commit
df3a673a61
1 file changed
+4
-1
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user