Commit b2fee23b by zihan

改回只用1个ws试试

parent db2f2afc
...@@ -10,6 +10,8 @@ const constants = require('./constants'); ...@@ -10,6 +10,8 @@ const constants = require('./constants');
const {IPs, mergeDepth} = require('./util'); const {IPs, mergeDepth} = require('./util');
let totalOrderbook = {}; let totalOrderbook = {};
//todo 这里还要处理浮点数运算的问题
let getUpdatedData = function (currentData, response) { let getUpdatedData = function (currentData, response) {
const updateData = []; const updateData = [];
let newCount = 0; let newCount = 0;
...@@ -100,12 +102,12 @@ class biboxApi { ...@@ -100,12 +102,12 @@ class biboxApi {
console.log("fetch ws token error"); console.log("fetch ws token error");
this.subscribeSymbols(symbols, depth, callback); this.subscribeSymbols(symbols, depth, callback);
}else{ }else{
for(let i=0;i<3;i++){ // for(let i=0;i<3;i++){
const ip = IPs.length >i ? IPs[i]:IPs[IPs.length -1]; const ip = IPs[0];
setTimeout(()=>{ // setTimeout(()=>{
this._openWs(result, symbols, depth,ip, callback); this._openWs(result, symbols, depth,ip, callback);
},i*10000); // },i*10000);
} // }
} }
}); });
} }
......
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