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:
@@ -99,7 +99,7 @@ def deep_analyze():
|
||||
if not stock_code:
|
||||
return jsonify({'error': '股票代码不能为空'}), 400
|
||||
|
||||
df = algo_get_kline_data(stock_code, days=180)
|
||||
df = algo_get_kline_data(stock_code, days=120)
|
||||
if df is None or len(df) < 30:
|
||||
return jsonify({'error': 'K线数据不足'}), 400
|
||||
|
||||
|
||||
Reference in New Issue
Block a user