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

websocket订阅如何主动保持订阅在线 #11

Open
dzzhyk opened this issue Feb 17, 2024 · 2 comments
Open

websocket订阅如何主动保持订阅在线 #11

dzzhyk opened this issue Feb 17, 2024 · 2 comments

Comments

@dzzhyk
Copy link

dzzhyk commented Feb 17, 2024

使用python-sdk中的websocket订阅接收K线数据后,貌似超过24个小时没有接收到推送ws会话就会失效。

例如订阅的是日K数据,假设从周五开始订阅,经过周六周日两日休市,下周一开市后就无法被推送到新数据。

使用python-sdk的时候怎样做才能主动保持ws订阅一直在线呢?
以下是我使用python-sdk相关的代码

# 订阅、取消订阅,都是sdk包装的方法
quote_ctx.subscribe_candlesticks(symbol, period)
quote_ctx.unsubscribe_candlesticks(symbol, period)
@dzzhyk
Copy link
Author

dzzhyk commented Feb 17, 2024

或者说,需要自己手动处理ws订阅的断线重连吗?有没有示例可以提供下🤒

@sunli829
Copy link
Collaborator

sunli829 commented Feb 18, 2024

sdk里会自动重连,您反馈的问题我们检查一下

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

2 participants