perf: 6项性能与正确性优化

1. get_stock_name: 延迟批量保存缓存(60秒去抖),避免每次新缓存都写文件
2. get_stock_name: 优先从DB stock_realtime_price查name,未命中再调腾讯API
3. compute_comprehensive_score: 单股模式也使用_fund_flow_cache(30分钟TTL)
4. _get_kline_from_local_db: 移除conn.autocommit=True,避免污染连接池事务模式
5. deep_analyze: K线天数从180改为120,与实时检测统一
6. detect_all_signals: 已有指标列时跳过重复calc_all_indicators
This commit is contained in:
freedakgmail
2026-07-22 08:00:27 +08:00
parent 037d9cd26c
commit cf7341fc63
5 changed files with 60 additions and 19 deletions
-1
View File
@@ -172,7 +172,6 @@ def _get_kline_from_local_db(stock_code, days=120):
conn = get_db()
if not conn:
return None
conn.autocommit = True
start_date = (datetime.now() - timedelta(days=days)).strftime('%Y-%m-%d')
try:
with conn.cursor() as cur: