Commit 4d6bd4e9 by ken

试试看

parent 501d5be8
......@@ -90,12 +90,16 @@ const _subscribe = function(callback, opened_callback = false) {
function subscribe() {
_subscribe((data) => {
if (data.channel === accountInfoChannel) {
const coins = data.data.coins;
const balances = {};
for (const coin of coins) {
balances[coin.enName] = {"onOrder": coin.freez, "available": coin.available};
try {
const coins = data.data.coins;
const balances = {};
for (const coin of coins) {
balances[coin.enName] = {"onOrder": coin.freez, "available": coin.available};
}
redisClient.hset("balance", "zb", JSON.stringify(balances));
} catch (e) {
redisClient.hset("balance", "zb", JSON.stringify({}));
}
redisClient.hset("balance", "zb", JSON.stringify(balances));
} else {
const depth = data;
const key = depth.channel.replace('_', '').toUpperCase() + '@zb';
......@@ -164,7 +168,7 @@ function run() {
for (const symbol of observerSymbol) {
depthByRest(symbol);
}
}, 300);
}, 500);
}
run();
......
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