From 576848b143e6cd8acfd76c06da5efd00ed8eea12 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 17 Oct 2026 05:24:02 +0800 Subject: [PATCH] fix(types): retain typed monitor warning list --- app/monitor/syslimits.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/monitor/syslimits.py b/app/monitor/syslimits.py index 1e4afb9e4..4ced89dbb 100644 --- a/app/monitor/syslimits.py +++ b/app/monitor/syslimits.py @@ -43,10 +43,11 @@ def check_system_limits() -> Dict[str, Any]: 检查系统监控相关限制。 :return: 系统限制信息 """ + warnings: List[str] = [] limits = { 'max_user_watches': 0, 'max_user_instances': 0, - 'warnings': [] + 'warnings': warnings } try: @@ -65,7 +66,7 @@ def check_system_limits() -> Dict[str, Any]: except Exception as e: logger.debug(f"读取 inotify 实例限制失败: {e}") except Exception as e: - limits['warnings'].append(f"检查系统限制时出错: {e}") + warnings.append(f"检查系统限制时出错: {e}") return limits