🔨 添加缓存数据版本.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
package org.dromara.visor.framework.redis.configuration;
|
||||
|
||||
import cn.orionsec.kit.lang.define.cache.key.CacheKeyDefine;
|
||||
import org.dromara.visor.common.constant.AutoConfigureOrderConst;
|
||||
import org.dromara.visor.common.interfaces.Locker;
|
||||
import org.dromara.visor.common.utils.LockerUtils;
|
||||
@@ -31,6 +32,7 @@ import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.redisson.config.SingleServerConfig;
|
||||
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@@ -101,5 +103,15 @@ public class OrionRedisAutoConfiguration {
|
||||
return redisLocker;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 redis 数据版本
|
||||
*
|
||||
* @param dataVersion dataVersion
|
||||
*/
|
||||
@Value("${spring.redis.data-version}")
|
||||
public void setDataVersion(String dataVersion) {
|
||||
CacheKeyDefine.setGlobalPrefix("v" + dataVersion + ":");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
"description": "最小空闲连接数.",
|
||||
"defaultValue": "16"
|
||||
},
|
||||
{
|
||||
"name": "spring.redis.data-version",
|
||||
"type": "java.lang.String",
|
||||
"description": "redis 数据版本.",
|
||||
"defaultValue": "1"
|
||||
},
|
||||
{
|
||||
"name": "no.redis",
|
||||
"type": "java.lang.Boolean",
|
||||
|
||||
Reference in New Issue
Block a user