@@ -91,7 +91,7 @@ class TqApi(TqBaseApi):
91
91
"""
92
92
93
93
def __init__ (self , account : Optional [Union [TqMultiAccount , UnionTradeable ]] = None ,
94
- auth : Union [TqAuth , str , None ] = None ,
94
+ auth : Union [TqAuth , str , None ] = None ,deadline : Optional [ float ] = 60 ,
95
95
url : Optional [str ] = None , backtest : Union [TqBacktest , TqReplay , None ] = None ,
96
96
web_gui : Union [bool , str ] = False , debug : Union [bool , str , None ] = None ,
97
97
loop : Optional [asyncio .AbstractEventLoop ] = None , disable_print : bool = False , _stock : bool = True ,
@@ -290,12 +290,12 @@ def __init__(self, account: Optional[Union[TqMultiAccount, UnionTradeable]] = No
290
290
self ._setup_connection () # 初始化通讯连接
291
291
292
292
# 等待初始化完成
293
- deadline = time .time () + 60
293
+ _deadline = time .time () + deadline
294
294
try :
295
295
# 多账户时,所有账户需要初始化完成
296
296
trade_more_data = True
297
297
while self ._data .get ("mdhis_more_data" , True ) or trade_more_data :
298
- if not self .wait_update (deadline = deadline ): # 等待连接成功并收取截面数据
298
+ if not self .wait_update (_deadline = deadline ): # 等待连接成功并收取截面数据
299
299
raise TqTimeoutError ("接收数据超时,请检查客户端及网络是否正常" )
300
300
trade_more_data = self ._account ._get_trade_more_data (self ._data )
301
301
except :
0 commit comments