fix:将Akshare的多次调用转换为一次调用,一次获取整个A股行情,一次获取整个ETF行情,减少被反爬虫的几率#123
Closed
Wu-Gao wants to merge 0 commit intoZhuLinsen:mainfrom
Closed
fix:将Akshare的多次调用转换为一次调用,一次获取整个A股行情,一次获取整个ETF行情,减少被反爬虫的几率#123Wu-Gao wants to merge 0 commit intoZhuLinsen:mainfrom
Wu-Gao wants to merge 0 commit intoZhuLinsen:mainfrom
Conversation
🤖 自动审查报告
📁 修改的文件
🧠 AI 代码审查意见作为资深 Python 代码审查专家,我对此次代码变更进行了详细审查。 总体评价✅ 建议合入 这是一项非常出色的改进,通过引入批量预取和缓存机制,显著优化了实时行情数据的获取效率,减少了对 Akshare API 的调用次数,并提升了系统的健壮性。代码设计合理,考虑周全。 详细审查意见1. 🔒 安全性
2. 🐛 潜在 Bug
3. ⚡ 性能
4. 📖 可读性
5. 🏗️ 架构设计
|
|
感谢付出 |
Owner
|
Hi, PR #113 (Bot framework) has just been merged. Your current implementation of prefetch_all_realtime_quotes runs unconditionally, which means even a single stock query via the new bot would trigger a download of the entire market data (5000+ stocks). This will cause significant latency for bot users. Please rebase on main and modify the logic in main.py so that prefetching is only enabled when running in batch mode (e.g., when stocks list is empty or large). Thanks for the optimization! |
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.
变更类型
变更描述
将Akshare的多次调用转换为一次调用,之前的Akshare每个自选股都要调用一次,频率过高容易被反爬虫,现在修改为一次获取整个A股行情,一次获取整个ETF行情,减少被反爬虫的几率
关联 Issue
关联的 Issue 编号(如有):fixes #108 #109 #119
测试说明
描述如何测试这些变更:
检查清单
截图(如适用)
如有 UI 变更,请附上截图。
其他说明
其他需要说明的内容。