修复Redis返回默认值的问题
This commit is contained in:
@@ -80,21 +80,13 @@ public class RedisTools {
|
||||
if (isNotInstallRedis) {
|
||||
return value;
|
||||
}
|
||||
Jedis jedis = null;
|
||||
try {
|
||||
jedis = getRedis();
|
||||
try (Jedis jedis = getRedis()) {
|
||||
jedis.select(dbIndex);
|
||||
value = jedis.get(key);
|
||||
jedis.close();
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
// e.printStackTrace();
|
||||
} finally {
|
||||
if (jedis != null)
|
||||
jedis.close();
|
||||
}
|
||||
if(value==null){
|
||||
value="-999";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user