fix(factor): output_dir建目录兜底——VPS(Windows)首跑/tmp/factor不存在tears静默失败 [vps]
CI/CD / test (push) Successful in 3s
CI/CD / nas-deploy (push) Successful in 11s
CI/CD / nas-verify (push) Successful in 13s

API路径output_dir硬编码/tmp/factor是容器/NAS约定;Windows解析为当前盘根
\tmp\factor,首跑不存在且tears/心跳open直写不建目录→FileNotFoundError
→tears标注json_error静默降级+心跳全丢。os.makedirs exist_ok幂等修复,
赶上统一推vps班车。factor全套测绿
This commit is contained in:
2026-08-30 10:53:34 +08:00
parent 51c400030b
commit 5cc326dd4a
+5
View File
@@ -152,6 +152,11 @@ def run_factor_analysis(
report_paths={}
)
# 输出目录兜底建目录:API 路径 output_dir="/tmp/factor" 是容器/NAS 约定,
# VPS(Windows)首跑时该路径不存在 → tears JSON/心跳文件 open 直写会
# FileNotFoundError → tears 静默失败。exist_ok 幂等,已存在零成本。
os.makedirs(output_dir, exist_ok=True)
# Create AlphaLab session and load symbols
session = AlphaLabSession(lab_path=output_dir)
# 逐只加载 + 心跳(分钟级任务的可观测性:行情加载 i/N)