download_history_data2有时会卡在result为真的sleep调用里面,这个是已知问题吗?是不是可以加个超时时间。同样的,其他一些调用也建议加个全局超时时间以及调用局部的超时时间。
result = client.supply_history_data2(stock_list, spec_period, start_time, end_time, _BSON_.BSON.encode(param), on_progress)
if not result:
import time
try:
while not status[0] and client.is_connected():
_TIME_.sleep(0.1)
except:
if status[1] < status[2]:
client.stop_supply_history_data2()
_TRACEBACK_.print_exc()
if not client.is_connected():
raise Exception('行情服务连接断开')
if status[3]:
raise Exception('下载数据失败:' + status[3])
else:
while not status[0] and client.is_connected():
_TIME_.sleep(0.1)
return status[4]
|