Commit 88f6ec9e by ken

zb

parent 9cca8d76
......@@ -56,7 +56,7 @@ function subscribe() {
console.log(symbol + '@' + depth.timestamp * 1000 + ' latency=' + (Date.now() - depth.timestamp * 1000) + 'ms');
const publishContent = JSON.stringify({symbol, time: depth.timestamp * 1000})
const depthJson = JSON.stringify({asks: depth.asks.reverse(), bids: depth.bids, symbol})
redisClient.set(key, depthJson);
redisClient.set(key, depthJson, 'EX', 1.5);
redisClient.publish(publishKey, publishContent);
})
}
......
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