Commit f2f788ca by ken

depth

parent cbb58701
......@@ -193,9 +193,13 @@ function _handleDepthData(symbol, data, source) {
}
const lastDepthRestSendTimeMap = {};
let detphRestSentAmount = 0;
function depthByRest(symbol,callback) {
const url = `http://api.zb.cn/data/v1/depth?market=${symbol}&size=5`;
const urls = [`http://api.zb.cn/data/v1/depth?market=${symbol}&size=5`, `http://api.zb.com/data/v1/depth?market=${symbol}&size=5`];
detphRestSentAmount += 1;
const index = detphRestSentAmount % 2;
const url = urls[index];
const sendTime = Date.now();
_request("GET", url, (err, data) => {
const lastDepthRestSendTime = lastDepthRestSendTimeMap[symbol] || 0;
......
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