fix: 修复消息阻塞
This commit is contained in:
@@ -48,7 +48,10 @@ class BaseMessageAPI:
|
|||||||
while True:
|
while True:
|
||||||
if len(self.cache) > 0:
|
if len(self.cache) > 0:
|
||||||
for handler in self.message_handlers:
|
for handler in self.message_handlers:
|
||||||
|
try:
|
||||||
await handler(self.cache[0])
|
await handler(self.cache[0])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
self.cache.pop(0)
|
self.cache.pop(0)
|
||||||
if len(self.cache) > 0:
|
if len(self.cache) > 0:
|
||||||
await asyncio.sleep(0.1 / len(self.cache))
|
await asyncio.sleep(0.1 / len(self.cache))
|
||||||
|
|||||||
Reference in New Issue
Block a user