[moz] fix: S2 _steps_cache None 崩溃修复(司马懿 Review 反馈)

clear_cache() 中 _steps_cache.clear() 改为 _steps_cache = None,
避免在 get_steps() 之前调用时 AttributeError。
This commit is contained in:
cfdaily
2026-06-20 23:37:17 +08:00
parent e238eaec31
commit bae3244e24
+2 -1
View File
@@ -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
# ---------------------------------------------------------------------------