Commit d174f578 authored by shenjiaqing's avatar shenjiaqing

提交代码

parent 6ea7012e
......@@ -38,7 +38,7 @@ allprojects {
}
group = "cn.com.duiba.boot"
version = "0.0.12-SNAPSHOT"
version = "0.0.14"
}
subprojects {
......
......@@ -72,7 +72,8 @@ public class CacheConfig {
String packageName = pkg.getName();
if (packageName.startsWith("springfox.") || packageName.startsWith("org.")
|| packageName.startsWith("io.") || packageName.startsWith("net.")
|| packageName.startsWith("cn.com.duibaboot") || packageName.startsWith("com.netflix")) {
|| packageName.startsWith("cn.com.duibaboot") || packageName.startsWith("com.netflix")
|| packageName.startsWith("cn.com.duiba.tuia.pangea") ) {
continue;
}
Field[] fields = bean.getClass().getDeclaredFields();
......@@ -84,7 +85,7 @@ public class CacheConfig {
boolean isGuava = Cache.class.isAssignableFrom(field.getType());
boolean isCaffeine = AsyncCache.class.isAssignableFrom(field.getType());
if (!isCaffeine) {
if (!isCaffeine && !isGuava) {
continue;
}
field.setAccessible(true);
......@@ -109,7 +110,7 @@ public class CacheConfig {
}
}
}catch(Exception e){
logger.warn("缓存备份失败", e);
logger.warn("cache实例获取异常", e);
}
}
}
......@@ -119,7 +120,6 @@ public class CacheConfig {
@Order(Ordered.LOWEST_PRECEDENCE-1)
public void onServerCache(){
try{
logger.info("进来了");
// 本地缓存预热开关 : 默认关闭
if (!cacheEnable) {
logger.warn("Cache preheating failed,because cacheEnable is false");
......@@ -130,9 +130,9 @@ public class CacheConfig {
logger.warn("获取容器列表为空!");
return;
}
logger.info("container of all registered AppInfo : {}",instances);
logger.info("container of all registered AppInfo size: {}", instances.size());
List<InstanceInfo> list = instances.stream().sorted(Comparator.comparing(InstanceInfo::getLastUpdatedTimestamp).reversed()).collect(Collectors.toList());
logger.info("container of all registered AppInfo : {}",list);
logger.info("container of all registered AppInfo : {}", list);
if (CollectionUtils.isEmpty(list)) {
logger.warn("Cache preheating failed,because 服务启动获取【" + appName + "】列表信息为空");
return;
......@@ -157,7 +157,7 @@ public class CacheConfig {
field.setAccessible(true);
Object obj = field.get(bean);
if (!(obj instanceof Cache) || !(obj instanceof AsyncCache)) {
if (!(obj instanceof Cache) && !(obj instanceof AsyncCache)) {
continue;
}
......@@ -197,7 +197,7 @@ public class CacheConfig {
field.setAccessible(false);
} catch (Exception e) {
logger.warn("this bean : {} , no have method : {}, Lead to it cannot be deserialized , cause: {}", split[0], field.getName() + "Serialize", e);
logger.warn("this bean : {} , no have method : {}, Lead to it cannot be deserialized , cause: {}", split[0], field.getName() + " Serialize", e);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment