-
Notifications
You must be signed in to change notification settings - Fork 703
Open
Description
Brief description of bug
The TQ Api will lose WSS connection every night after 19:30.
Unfortunately, it will raise an error in ops time and cause the asyncio loop to collapse. And there is no other parameter I can use to get the connection status of the WSS connection.
To solve the problem currently, I have to restart the program every night.
Self-Diagnosis
- I have reviewed the documentation.
- I have tried to use the latest version tqsdk==3.7.1.
- I have searched the issues for an answer to my question and I think other issues are caused by this problem like 夜盘开始后,无法接收数据 #483
Environment(for bug reports)
- Operating System: Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-40-generic x86_64)
- IDE version: Pycharm 2024.1.5 (Professional Edition)
- TQ API version: tqsdk==3.7.1
My configuration/Related code
import time
from datetime import datetime
from tqsdk import TqApi, TqAuth
tq_user = ''
tq_pwd = ''
tq_api = TqApi(auth=TqAuth(tq_user, tq_pwd))
tq_lst = tq_api.get_quote_list(['SHFE.au2504'])
print(tq_lst)
while True:
tq_api.wait_update(deadline=time.time() + 2.0)
dt = datetime.strptime(tq_lst[0]['datetime'], '%Y-%m-%d %H:%M:%S.%f')
print(dt.timestamp())
Steps to Reproduce the Issue
- connect to TQ API
- no other network error before 19:00
- wait until 19:00
Current Result
连接失败,每日 19:00-19:30 为日常运维时间,请稍后再试
Metadata
Metadata
Assignees
Labels
No labels