Commit 5ed5eefa by zihan

代码调整

parent 5e4dfd1f
...@@ -44,29 +44,6 @@ class BiboxCollector extends BaseCollector{ ...@@ -44,29 +44,6 @@ class BiboxCollector extends BaseCollector{
return 10 *1000; return 10 *1000;
} }
// _requestSymbolFullOrderbook(index,symbols,depth,baseCollectorCallback){
// if(index < symbols.length){
// this._doSubscribeSymbols(symbols,baseCollectorCallback,depth);
// }else{
// const symbol = symbols[index];
// const ipAddress = IPs[index%IPs.length];
//
// this.api.getOrderbook(symbol,depth,ipAddress,(error,result)=>{
// if(error){
// console.error("get depth by rest error:");
// console.error(error);
// this._requestSymbolFullOrderbook(index,symbols,depth,baseCollectorCallback);
// return;
// }
// const data = result.data;
// const timeStamp = data.timestamp;
// baseCollectorCallback(data.SELL.slice(0,depth).map((item)=>[item[0],item[1]]),data.BUY.slice(0,depth).map((item)=>[item[0],item[1]]),symbol,timeStamp);
// totalOrderbook[symbol]={asks:data.SELL,bids:data.BUY};
// this._requestSymbolFullOrderbook(index+1,symbols,depth,baseCollectorCallback);
// });
// }
// }
_subscribeSymbols(symbols,callback,subscribeDepth){ _subscribeSymbols(symbols,callback,subscribeDepth){
this._fetchDepthByWebsocket(symbols,subscribeDepth,callback) this._fetchDepthByWebsocket(symbols,subscribeDepth,callback)
} }
...@@ -115,7 +92,7 @@ class BiboxCollector extends BaseCollector{ ...@@ -115,7 +92,7 @@ class BiboxCollector extends BaseCollector{
const data = result.data; const data = result.data;
const timeStamp = result.timestamp; const timeStamp = result.timestamp;
const symbol = result.symbol; const symbol = result.symbol;
callback(data.SELL.slice(0, depth).map((item)=>[item[0], item[1]]), data.BUY.slice(0, depth).map((item)=>[item[0], item[1]]), symbol, timeStamp); callback(data.SELL.slice(0, depth), data.BUY.slice(0, depth), symbol, timeStamp);
} }
}) })
} }
......
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