fix: 不构成操作建议不推XMPP+代码降级改报错+LLM失败=None

This commit is contained in:
知微
2026-07-10 13:29:32 +08:00
parent ba70700e4d
commit b9ba737248
2 changed files with 4 additions and 7 deletions
+3 -3
View File
@@ -457,15 +457,15 @@ def main():
_full_analysis_text = _llm_out
print(f" ✅ LLM12维分析完成({len(_full_analysis_text)}字)", flush=True)
except Exception as _e:
print(f" LLM调用失败: {_e},使用代码降级", file=__import__('sys').stderr)
_full_analysis_text = _build_full_analysis(code, entry, result)
print(f" LLM12维分析失败: {_e}", file=__import__('sys').stderr)
_full_analysis_text = None
# 保存到DB
_fa_conn = __import__('sqlite3').connect("/home/hmo/MoFin/data/mofin.db")
_fa_conn.execute("UPDATE holding_strategies SET full_analysis=?, reassessed_at=? WHERE code=? AND status='active'", (_full_analysis_text, __import__('datetime').datetime.now().isoformat(), code))
_fa_conn.commit()
_fa_conn.close()
print(f" ✅ 完整维分析已保存({len(_full_analysis_text)}字)")
print(f" ✅ 完整12维分析已保存({len(_full_analysis_text)}字)" if _full_analysis_text else f" ⚠️ 12维分析未完成,跳过保存")
print(f" [DB] holding_strategies 已更新: {code}")
# 从LLM输出提取信号
if _full_analysis_text and '【综合结论】' in _full_analysis_text:
+1 -4
View File
@@ -435,10 +435,7 @@ def run_once(round_label=""):
outputs.append(f" 📨 区间触发重评→已推送Dad: {action}")
else:
reason = f"重评结果:{timing_signal},不构成操作建议"
if _can_push(code, key + "_note"):
msg = f"📋 {name}({code}) 价{price}{zone_desc}{reason}"
push_to_xmpp(msg)
outputs.append(f" 📨 区间触发→已推送说明: {reason}")
outputs.append(f" 📋 本地日志(不推): {reason}")
except Exception as e:
outputs.append(f" ⚠️ 区间重评失败: {e}")
state[code][key] = True