🔨 添加缓存数据版本.
This commit is contained in:
@@ -15,6 +15,8 @@ MYSQL_ROOT_PASSWORD=Data@123456
|
|||||||
|
|
||||||
REDIS_HOST=redis
|
REDIS_HOST=redis
|
||||||
REDIS_PASSWORD=Data@123456
|
REDIS_PASSWORD=Data@123456
|
||||||
|
REDIS_DATABASE=0
|
||||||
|
REDIS_DATA_VERSION=1
|
||||||
|
|
||||||
GUACD_HOST=guacd
|
GUACD_HOST=guacd
|
||||||
GUACD_PORT=4822
|
GUACD_PORT=4822
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ services:
|
|||||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-Data@123456}
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-Data@123456}
|
||||||
REDIS_HOST: ${REDIS_HOST:-redis}
|
REDIS_HOST: ${REDIS_HOST:-redis}
|
||||||
REDIS_PASSWORD: ${REDIS_PASSWORD:-Data@123456}
|
REDIS_PASSWORD: ${REDIS_PASSWORD:-Data@123456}
|
||||||
|
REDIS_DATABASE: ${REDIS_DATABASE:-0}
|
||||||
|
REDIS_DATA_VERSION: ${REDIS_DATA_VERSION:-1}
|
||||||
GUACD_HOST: ${GUACD_HOST:-guacd}
|
GUACD_HOST: ${GUACD_HOST:-guacd}
|
||||||
GUACD_PORT: ${GUACD_PORT:-4822}
|
GUACD_PORT: ${GUACD_PORT:-4822}
|
||||||
GUACD_DRIVE_PATH: ${GUACD_DRIVE_PATH:-/drive}
|
GUACD_DRIVE_PATH: ${GUACD_DRIVE_PATH:-/drive}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.framework.redis.configuration;
|
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.constant.AutoConfigureOrderConst;
|
||||||
import org.dromara.visor.common.interfaces.Locker;
|
import org.dromara.visor.common.interfaces.Locker;
|
||||||
import org.dromara.visor.common.utils.LockerUtils;
|
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.api.RedissonClient;
|
||||||
import org.redisson.config.SingleServerConfig;
|
import org.redisson.config.SingleServerConfig;
|
||||||
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
@@ -101,5 +103,15 @@ public class OrionRedisAutoConfiguration {
|
|||||||
return redisLocker;
|
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": "最小空闲连接数.",
|
"description": "最小空闲连接数.",
|
||||||
"defaultValue": "16"
|
"defaultValue": "16"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "spring.redis.data-version",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "redis 数据版本.",
|
||||||
|
"defaultValue": "1"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "no.redis",
|
"name": "no.redis",
|
||||||
"type": "java.lang.Boolean",
|
"type": "java.lang.Boolean",
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ spring:
|
|||||||
host: ${REDIS_HOST:127.0.0.1}
|
host: ${REDIS_HOST:127.0.0.1}
|
||||||
port: ${REDIS_PORT:6379}
|
port: ${REDIS_PORT:6379}
|
||||||
password: ${REDIS_PASSWORD:Data@123456}
|
password: ${REDIS_PASSWORD:Data@123456}
|
||||||
|
database: ${REDIS_DATABASE:10}
|
||||||
|
data-version: ${REDIS_DATA_VERSION:1}
|
||||||
redisson:
|
redisson:
|
||||||
threads: 2
|
threads: 2
|
||||||
netty-threads: 2
|
netty-threads: 2
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ spring:
|
|||||||
host: ${REDIS_HOST:127.0.0.1}
|
host: ${REDIS_HOST:127.0.0.1}
|
||||||
port: ${REDIS_PORT:6379}
|
port: ${REDIS_PORT:6379}
|
||||||
password: ${REDIS_PASSWORD:Data@123456}
|
password: ${REDIS_PASSWORD:Data@123456}
|
||||||
|
database: ${REDIS_DATABASE:0}
|
||||||
|
data-version: ${REDIS_DATA_VERSION:1}
|
||||||
redisson:
|
redisson:
|
||||||
threads: 4
|
threads: 4
|
||||||
netty-threads: 4
|
netty-threads: 4
|
||||||
|
|||||||
Reference in New Issue
Block a user