From bae3244e2482d7b8df18ea4313e6f44280edb98f Mon Sep 17 00:00:00 2001 From: cfdaily Date: Sat, 20 Jun 2026 23:37:17 +0800 Subject: [PATCH] =?UTF-8?q?[moz]=20fix:=20S2=20=5Fsteps=5Fcache=20None=20?= =?UTF-8?q?=E5=B4=A9=E6=BA=83=E4=BF=AE=E5=A4=8D=EF=BC=88=E5=8F=B8=E9=A9=AC?= =?UTF-8?q?=E6=87=BF=20Review=20=E5=8F=8D=E9=A6=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clear_cache() 中 _steps_cache.clear() 改为 _steps_cache = None, 避免在 get_steps() 之前调用时 AttributeError。 --- src/daemon/toolchain_templates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/daemon/toolchain_templates.py b/src/daemon/toolchain_templates.py index e767188..9dc5b81 100644 --- a/src/daemon/toolchain_templates.py +++ b/src/daemon/toolchain_templates.py @@ -87,7 +87,8 @@ def render_template(name: str, variables: Dict[str, str]) -> str: def clear_cache() -> None: """清空模板缓存(用于测试或热更新)""" _template_cache.clear() - _steps_cache.clear() + global _steps_cache + _steps_cache = None # 重置为 None,强制下次 reload # ---------------------------------------------------------------------------