Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Tianqin Api will lose websocket connection every night after 19:30 #493

Open
6 tasks done
zhengyoungzy opened this issue Sep 4, 2024 · 0 comments
Open
6 tasks done

Comments

@zhengyoungzy
Copy link

Brief description of bug

The TQ Api will lose WSS connection every night after 19:30.
image
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

  1. connect to TQ API
  2. no other network error before 19:00
  3. wait until 19:00

Current Result

连接失败,每日 19:00-19:30 为日常运维时间,请稍后再试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant