Commit 4af36107 by rongjun

bug

parent 9ed0ecc2
...@@ -81,7 +81,9 @@ class biboxApi { ...@@ -81,7 +81,9 @@ class biboxApi {
if(response.type === 'ack'){ if(response.type === 'ack'){
const id = response.id; const id = response.id;
setInterval(()=>{ setInterval(()=>{
wss.send(JSON.stringify({id,type:'ping'})) if(wss.readyState === constants.SocketReadyStateOpen){
wss.send(JSON.stringify({id,type:'ping'}))
}
},40000); },40000);
for(const symbol of symbols){ for(const symbol of symbols){
this._subscribeSymbol(wss, id, symbol, depth) this._subscribeSymbol(wss, id, symbol, depth)
...@@ -115,8 +117,6 @@ class biboxApi { ...@@ -115,8 +117,6 @@ class biboxApi {
updateData = [[response.data.price, newCount]]; updateData = [[response.data.price, newCount]];
} }
asks = mergeDepth(asks, updateData, true); asks = mergeDepth(asks, updateData, true);
console.log(updateData)
console.log(asks)
}else if(response.data.type === 'BUY'){ }else if(response.data.type === 'BUY'){
const oldD = totalOrderbook[symbol]; const oldD = totalOrderbook[symbol];
let has = false; let has = false;
......
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