mirror of
https://gitee.com/huoyo/ko-time.git
synced 2025-12-06 16:58:26 +08:00
update redis's saver
This commit is contained in:
parent
5471511b94
commit
675c448bbc
@ -24,10 +24,19 @@ public class DefaultConfig {
|
|||||||
private String redisTemplate;
|
private String redisTemplate;
|
||||||
private Integer threadNum;
|
private Integer threadNum;
|
||||||
private String contextPath;
|
private String contextPath;
|
||||||
|
private String dataPrefix;
|
||||||
private Boolean authEnable;
|
private Boolean authEnable;
|
||||||
private String userName;
|
private String userName;
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
public String getDataPrefix() {
|
||||||
|
return dataPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataPrefix(String dataPrefix) {
|
||||||
|
this.dataPrefix = dataPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
public String getRedisTemplate() {
|
public String getRedisTemplate() {
|
||||||
return redisTemplate;
|
return redisTemplate;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,6 +70,7 @@ public class LoadConfig {
|
|||||||
config.setExceptionEnable(defaultConfig.getExceptionEnable() == null ? exceptionEnable : defaultConfig.getExceptionEnable());
|
config.setExceptionEnable(defaultConfig.getExceptionEnable() == null ? exceptionEnable : defaultConfig.getExceptionEnable());
|
||||||
config.setSaver(defaultConfig.getSaver() == null ? saveSaver : defaultConfig.getSaver());
|
config.setSaver(defaultConfig.getSaver() == null ? saveSaver : defaultConfig.getSaver());
|
||||||
config.setEnable(defaultConfig.getEnable() == null ? kotimeEnable : defaultConfig.getEnable());
|
config.setEnable(defaultConfig.getEnable() == null ? kotimeEnable : defaultConfig.getEnable());
|
||||||
|
config.setDataPrefix(defaultConfig.getDataPrefix() == null ? "KOTIME" : defaultConfig.getDataPrefix());
|
||||||
config.setContextPath(defaultConfig.getContextPath());
|
config.setContextPath(defaultConfig.getContextPath());
|
||||||
config.setLanguage(defaultConfig.getLanguage() == null ? "chinese" : defaultConfig.getLanguage());
|
config.setLanguage(defaultConfig.getLanguage() == null ? "chinese" : defaultConfig.getLanguage());
|
||||||
config.setThreadNum(defaultConfig.getThreadNum() == null ? 2 : defaultConfig.getThreadNum());
|
config.setThreadNum(defaultConfig.getThreadNum() == null ? 2 : defaultConfig.getThreadNum());
|
||||||
|
|||||||
@ -26,11 +26,11 @@ import static java.util.stream.Collectors.toList;
|
|||||||
@Component("redis")
|
@Component("redis")
|
||||||
public class RedisBase implements GraphService {
|
public class RedisBase implements GraphService {
|
||||||
|
|
||||||
private static final String methodPre = "KO_METHODS:";
|
private static final String methodPre = Context.getConfig().getDataPrefix()+":KO_METHODS:";
|
||||||
private static final String exceptionPre = "KO_EXCEPTIONS:";
|
private static final String exceptionPre = Context.getConfig().getDataPrefix()+":KO_EXCEPTIONS:";
|
||||||
private static final String methodRelationPre = "KO_METHOD_RES:";
|
private static final String methodRelationPre = Context.getConfig().getDataPrefix()+":KO_METHOD_RES:";
|
||||||
private static final String exceptionRelationPre = "KO_EXCEPTION_RES:";
|
private static final String exceptionRelationPre = Context.getConfig().getDataPrefix()+":KO_EXCEPTION_RES:";
|
||||||
private static final String paramValueMetricMapPre = "KO_PARAMETERS:";
|
private static final String paramValueMetricMapPre = Context.getConfig().getDataPrefix()+":KO_PARAMETERS:";
|
||||||
|
|
||||||
private static StringRedisTemplate redisTemplate;
|
private static StringRedisTemplate redisTemplate;
|
||||||
|
|
||||||
|
|||||||
@ -74,6 +74,13 @@
|
|||||||
"description": "datasource",
|
"description": "datasource",
|
||||||
"sourceType": "cn.langpy.kotime.config.DefaultConfig"
|
"sourceType": "cn.langpy.kotime.config.DefaultConfig"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ko-time.data-prefix",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"defaultValue": "",
|
||||||
|
"description": "dataPrefix",
|
||||||
|
"sourceType": "cn.langpy.kotime.config.DefaultConfig"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "ko-time.redis-template",
|
"name": "ko-time.redis-template",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.String",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user