Commit b5253a67 by zihan

添加订阅交易对的时间间隔

parent a56e00cd
...@@ -126,8 +126,11 @@ class biboxApi { ...@@ -126,8 +126,11 @@ class biboxApi {
wss.send(JSON.stringify({id, type: 'ping'})) wss.send(JSON.stringify({id, type: 'ping'}))
} }
}, 40000); }, 40000);
for (const symbol of symbols) { for (let i=0;i<symbols.length;i++) {
this._subscribeSymbol(wss, id, symbol, depth) const symbol = symbols[i];
setTimeout(()=>{
this._subscribeSymbol(wss, id, symbol, depth)
},i*10);
} }
} else if (response.topic && response.topic.startsWith('/trade')) { } else if (response.topic && response.topic.startsWith('/trade')) {
const timeStamp = response.data.time; const timeStamp = response.data.time;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment