mirror of https://github.com/Mai-with-u/MaiBot.git
fix:尝试修复模型请求失败炸循环
parent
e2205eb78b
commit
72d1ff7cd9
|
|
@ -29,7 +29,10 @@ class BaseMessageHandler:
|
||||||
try:
|
try:
|
||||||
tasks.append(handler(message))
|
tasks.append(handler(message))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise RuntimeError(str(e)) from e
|
logger.error(f"消息处理出错: {str(e)}")
|
||||||
|
logger.error(traceback.format_exc())
|
||||||
|
# 不抛出异常,而是记录错误并继续处理其他消息
|
||||||
|
continue
|
||||||
if tasks:
|
if tasks:
|
||||||
await asyncio.gather(*tasks, return_exceptions=True)
|
await asyncio.gather(*tasks, return_exceptions=True)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue