Micro-sheep / Micro-sheep/efinance
get_realtime_quotes在每访问一次间隔一秒的频率下运行半小时就会发生异常报错
- Dominant language
- Python
- Stars
- 4.1k
- Forks
- 755
- PR merge metrics
- No merged PRs in 30d
Description
efinance的版本是 0.5.5.2,get_realtime_quotes这个函数在今年4月12号之前以每访问一次间隔一秒的频率运行一直是正常的,但从4月14号开始就开发以这种频率下运行半小时就会发生异常报错,报错信息为“HttpConnectionPool(host='push2.eastmoney.com',prot=80):Max retries exceeded with url:
Caused by ProtocolError(connection aborted,RemoteDisconnected('Remote end closed connection without response'))”。感觉可能是东财网为了防止并发访问而采取的防范措施,看代码get_realtime_quotes里面使用了线程池,这个效率上确实很快,可能调用的人多了就加了防范措施。我们这种自己写量化程序的,最怕的就是没有一个稳定的数据源,没有数据再好的量化算法也白搭。麻烦大神看看有没有什么办法解决。
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the get_realtime_quotes entry point in efinance 0.5.5.2 and reproduce the failure with one-second-spaced requests for about half an hour. Inspect how its thread pool handles requests and the reported RemoteDisconnected error; done means repeated quote retrieval no longer fails under the described workload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100