mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-25 21:28:21 +00:00
update redisson 3.18.0 => 3.19.0
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -32,7 +32,7 @@
|
|||||||
<poi.version>5.2.3</poi.version>
|
<poi.version>5.2.3</poi.version>
|
||||||
<easyexcel.version>3.1.3</easyexcel.version>
|
<easyexcel.version>3.1.3</easyexcel.version>
|
||||||
<hutool.version>5.8.10</hutool.version>
|
<hutool.version>5.8.10</hutool.version>
|
||||||
<redisson.version>3.18.0</redisson.version>
|
<redisson.version>3.19.0</redisson.version>
|
||||||
<lock4j.version>2.2.3</lock4j.version>
|
<lock4j.version>2.2.3</lock4j.version>
|
||||||
<xxl-job.version>2.3.1</xxl-job.version>
|
<xxl-job.version>2.3.1</xxl-job.version>
|
||||||
<satoken.version>1.33.0</satoken.version>
|
<satoken.version>1.33.0</satoken.version>
|
||||||
|
@@ -4,7 +4,6 @@ import com.ruoyi.common.core.utils.SpringUtils;
|
|||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.redisson.api.*;
|
import org.redisson.api.*;
|
||||||
import org.redisson.config.Config;
|
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -27,14 +26,6 @@ public class RedisUtils {
|
|||||||
|
|
||||||
private static final RedissonClient CLIENT = SpringUtils.getBean(RedissonClient.class);
|
private static final RedissonClient CLIENT = SpringUtils.getBean(RedissonClient.class);
|
||||||
|
|
||||||
public static NameMapper getNameMapper() {
|
|
||||||
Config config = CLIENT.getConfig();
|
|
||||||
if (config.isClusterConfig()) {
|
|
||||||
return config.useClusterServers().getNameMapper();
|
|
||||||
}
|
|
||||||
return config.useSingleServer().getNameMapper();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 限流
|
* 限流
|
||||||
*
|
*
|
||||||
@@ -437,8 +428,8 @@ public class RedisUtils {
|
|||||||
* @return 对象列表
|
* @return 对象列表
|
||||||
*/
|
*/
|
||||||
public static Collection<String> keys(final String pattern) {
|
public static Collection<String> keys(final String pattern) {
|
||||||
Stream<String> stream = CLIENT.getKeys().getKeysStreamByPattern(getNameMapper().map(pattern));
|
Stream<String> stream = CLIENT.getKeys().getKeysStreamByPattern(pattern);
|
||||||
return stream.map(key -> getNameMapper().unmap(key)).collect(Collectors.toList());
|
return stream.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -447,7 +438,7 @@ public class RedisUtils {
|
|||||||
* @param pattern 字符串前缀
|
* @param pattern 字符串前缀
|
||||||
*/
|
*/
|
||||||
public static void deleteKeys(final String pattern) {
|
public static void deleteKeys(final String pattern) {
|
||||||
CLIENT.getKeys().deleteByPattern(getNameMapper().map(pattern));
|
CLIENT.getKeys().deleteByPattern(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -457,7 +448,7 @@ public class RedisUtils {
|
|||||||
*/
|
*/
|
||||||
public static Boolean hasKey(String key) {
|
public static Boolean hasKey(String key) {
|
||||||
RKeys rKeys = CLIENT.getKeys();
|
RKeys rKeys = CLIENT.getKeys();
|
||||||
return rKeys.countExists(getNameMapper().map(key)) > 0;
|
return rKeys.countExists(key) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user