Commit 5a1da48c by ken

修改有效期

parent 80b888f2
...@@ -81,7 +81,7 @@ function subscribe() { ...@@ -81,7 +81,7 @@ function subscribe() {
console.log(symbol + '@' + depth.timestamp * 1000 + ' from websocket'); console.log(symbol + '@' + depth.timestamp * 1000 + ' from websocket');
const publishContent = JSON.stringify({symbol, time: depth.timestamp * 1000}); const publishContent = JSON.stringify({symbol, time: depth.timestamp * 1000});
const depthJson = JSON.stringify({asks: depth.asks.reverse(), bids: depth.bids, symbol}); const depthJson = JSON.stringify({asks: depth.asks.reverse(), bids: depth.bids, symbol});
redisClient.set(key, depthJson, 'EX', 1); redisClient.set(key, depthJson, 'EX', 2);
redisClient.publish(publishKey, publishContent); redisClient.publish(publishKey, publishContent);
} }
} }
...@@ -124,7 +124,7 @@ function depthByRest(symbol,callback) { ...@@ -124,7 +124,7 @@ function depthByRest(symbol,callback) {
console.log(symbol + '@' + data.timestamp * 1000 + ' from rest'); console.log(symbol + '@' + data.timestamp * 1000 + ' from rest');
const publishContent = JSON.stringify({symbol, time: data.timestamp * 1000}); const publishContent = JSON.stringify({symbol, time: data.timestamp * 1000});
const depthJson = JSON.stringify({asks: data.asks.reverse(), bids: data.bids, symbol}); const depthJson = JSON.stringify({asks: data.asks.reverse(), bids: data.bids, symbol});
redisClient.set(key, depthJson, 'EX', 1); redisClient.set(key, depthJson, 'EX', 2);
redisClient.publish(publishKey, publishContent); 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