返回列表 发布新帖

download_history_data2等调用没有超时时间的设计?有时候会卡住

44 0
发表于 前天 15:37 | 显示全部楼层 阅读模式

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]

回复

您需要登录后才可以回帖 登录 | 立即注册

客服专线

400-080-8112

用思考的速度交易,用真诚的态度合作,我们是认真的!
  • 关注公众号
  • 添加微信客服
Copyright © 2001-2025 迅投QMT社区 版权所有 All Rights Reserved. 京ICP备2025122616号-3
关灯 快速发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表