refactor: bound async log writer shutdown

This commit is contained in:
jxxghp
2026-08-24 15:20:10 +08:00
parent 8826219173
commit e9053a6562
8 changed files with 350 additions and 48 deletions
+2 -1
View File
@@ -582,7 +582,8 @@ async def lifespan(app: FastAPI):
finally:
try:
# 日志最后关闭,确保其他组件的收尾信息已写入文件
LoggerManager.shutdown()
if LoggerManager.shutdown() is False:
raise RuntimeError("日志写入资源未在关停预算内收敛")
finally:
if main_loop_owner is not None:
global_vars.clear_loop(main_loop_owner)