feat: 更新 @riwa/api-types 依赖版本至 0.0.135;优化 TradingView 数据源和 WebSocket 错误处理逻辑
This commit is contained in:
@@ -212,6 +212,7 @@ export class RWADatafeed extends Datafeeds.UDFCompatibleDatafeed {
|
||||
channels: [{
|
||||
name: "bar",
|
||||
symbol: symbolInfo.name,
|
||||
resolution,
|
||||
}],
|
||||
});
|
||||
|
||||
|
||||
@@ -7,6 +7,13 @@ export class TradeWebSocket {
|
||||
if (!this.socket) {
|
||||
this.socket = client.api.market_data.streaming.subscribe();
|
||||
}
|
||||
this.socket.on("error", () => {
|
||||
this.socket = null;
|
||||
this.socket = client.api.market_data.streaming.subscribe();
|
||||
});
|
||||
this.socket.on("open", () => {
|
||||
console.log("TradeWebSocket connected");
|
||||
});
|
||||
}
|
||||
|
||||
public getSocket(): MarketDataStreaming {
|
||||
|
||||
Reference in New Issue
Block a user