openapi-sdk icon indicating copy to clipboard operation
openapi-sdk copied to clipboard

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

Open dzzhyk opened this issue 1 year ago • 2 comments

使用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 avatar Feb 17 '24 08:02 dzzhyk

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

dzzhyk avatar Feb 17 '24 08:02 dzzhyk

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

sunli829 avatar Feb 18 '24 09:02 sunli829

Hi, 我们正在努力清理问题,并关闭可能不再相关的旧问题。如果你依然还有类似的问题,请通过评论此问题让我们知道,我们会重新开启。如果您无法重现,请随时自行关闭问题,我们也有定期任务清理 14 天之前的旧问题。 We are actively cleaning up issues and closing those that may no longer be relevant. If you still have similar issues, please comment on this issue to reopen it. If you cannot reproduce the issue, please close it yourself, and we also have a scheduled task to clean up issues older than 14 days. Thank you!

github-actions[bot] avatar Mar 26 '25 05:03 github-actions[bot]

由于没有活动,此问题已关闭。如果您仍遇到此问题,请打开一个新问题并附上此问题的链接。 This issue was closed due to inactivity. If you still encounter this issue, please open a new issue and link to this issue. Thank you.

github-actions[bot] avatar Apr 07 '25 03:04 github-actions[bot]