Commit 6cc206a0 by tangzy

改用redis的连接

parent 02d857a4
......@@ -107,8 +107,6 @@ public class RedisUtil {
}
public static void set(String key, Object value, int sessionTimeOut) throws Exception {
// checkRedisNodeAvailable();
try {
masterNode.opsForValue().set(key, value);
masterNode.expire(key, sessionTimeOut, TimeUnit.SECONDS);
......@@ -119,33 +117,31 @@ public class RedisUtil {
}
public static Object get(String key) throws Exception {
// checkRedisNodeAvailable();
// Object values=null;
try {
return masterNode.opsForValue().get(key);
} catch (Exception e) {
e.printStackTrace();
checkRedisNodeAvailable();
}
return null;
}
public static Boolean delete(String key) throws Exception {
// checkRedisNodeAvailable();
try {
return masterNode.delete(key);
} catch (Exception e) {
e.printStackTrace();
checkRedisNodeAvailable();
}
return false;
}
public static Set keys(String key) throws Exception {
// checkRedisNodeAvailable();
try {
return masterNode.keys(key + "*");
} catch (Exception e) {
e.printStackTrace();
checkRedisNodeAvailable();
}
return new HashSet();
}
......
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