chenditc / investment_data

Scripts and doc for https://www.dolthub.com/repositories/chenditc/investment_data
241 stars 49 forks source link

normalize.py 出现网络错误 #43

Open rain1475 opened 3 months ago

rain1475 commented 3 months ago

发现获取日历的时候被深交所www.szse.cn屏蔽,正常浏览器都无法访问深交所。 怀疑访问过于频繁,是否应该加一个delay?

日志 C:\Projects\Quant\Quant1\bin\Debug\net7.0>python ./normalize.py normalize_data --source_dir C:\Projects\Quant\Quant1\bin\Debug\net7.0\output\ --normalize_dir C:\Projects\Quant\Quant1\bin\Debug\net7.0\output_normalize\ --max_workers=28 --date_field_name="tradedate" 2024-04-12 18:31:40.760 | INFO | data_collector.utils:get_calendar_list:68 - get calendar list: ALL...... 2024-04-12 18:33:17.852 | WARNING | data_collector.utils:wrapper:491 - _get_calendar: 1 :2000-01-->HTTPConnectionPool(host='www.szse.cn', port=80): Read timed out. (read timeout=None)

chenditc commented 3 months ago

@rain1475 试过换个 ip 就能访问了么?

rain1475 commented 3 months ago

@rain1475 试过换个 ip 就能访问了么?

换ip可以访问,等5-30分钟也可恢复访问,最长也试过等1个半小时才恢复访问。

chenditc commented 3 months ago

这个代码似乎是 qlib 项目里的,我只引用了 qlib 里的库,如果要优化的话,可以贡献到 qlib 项目里