fix: WebSocket推送管理页面核心功能修复#9
Merged
Merged
Conversation
- 前端Socket.IO连接地址从硬编码127.0.0.1:5001改为window.location.origin - 修复推送服务调用4个不存在的方法: - get_active_stocks() → get_available_minute_stocks() - get_latest_data() → get_minute_latest_data() + DataFrame访问 - get_top_movers() → 用detect_anomalies()替代 - calculate_market_sentiment() → get_market_sentiment() - 修复get_market_overview()在错误的service上调用(monitor→data_manager) - 推送线程从threading.Thread改为socketio.start_background_task, 解决eventlet模式下无法emit到客户端的问题 - 添加周期fallback(1min→5min→15min→30min→60min)应对数据缺失 - test-connection API返回正确的ISO时间戳而非connection_stats字典 - 涨跌幅计算取2条记录用前一条close作为prev_close - 实时数据展示条件显示省略号后缀 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 移除废弃的 self.push_thread 和 stop_push_service 中的 join 调用 - 移除重复的 log line - detect_anomalies 返回值解包为 anomalies 列表,不再传包装 dict - detect_anomalies 失败时降级为空列表 - 新增 9 个生命周期与合约测试 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
/realtime-analysis/websocket页面存在多个阻断性问题,导致核心功能完全不可用:127.0.0.1:5001,服务器运行在 5000,"连接"按钮永远无法成功threading.Thread在 eventlet 模式下无法 emit 到客户端修复内容
P0 — 阻断性修复
websocket_management.htmlwindow.location.originwebsocket_push_service.pyget_active_stocks()→get_available_minute_stocks()websocket_push_service.pyget_latest_data()→get_minute_latest_data()+ DataFrame 访问方式websocket_push_service.pyget_top_movers()删除,用detect_anomalies()替代websocket_push_service.pycalculate_market_sentiment()→get_market_sentiment()websocket_push_service.pyget_market_overview()从 monitor_service 改到 data_managerwebsocket_push_service.pythreading.Thread→socketio.start_background_task+socketio.sleepP1 — 功能改进
websocket_push_service.pywebsocket_api.pyP2 — 小修复
websocket_push_service.pywebsocket_management.html验证
success: true🤖 Generated with Claude Code