Commit e2c09651 by tangzy

改用redis的连接

parent 6cc206a0
......@@ -108,8 +108,10 @@ public class RedisUtil {
public static void set(String key, Object value, int sessionTimeOut) throws Exception {
try {
masterNode.opsForValue().set(key, value);
masterNode.expire(key, sessionTimeOut, TimeUnit.SECONDS);
// masterNode.opsForValue().set(key, value);
// masterNode.expire(key, sessionTimeOut, TimeUnit.SECONDS);
//使用setex实现,减一次连接
masterNode.opsForValue().set(key,value,sessionTimeOut, TimeUnit.SECONDS);
} catch (Exception e) {
e.printStackTrace();
checkRedisNodeAvailable();
......
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