Commit 6ea7012e authored by shenjiaqing's avatar shenjiaqing

提交代码

parent 3143f352
...@@ -38,7 +38,7 @@ allprojects { ...@@ -38,7 +38,7 @@ allprojects {
} }
group = "cn.com.duiba.boot" group = "cn.com.duiba.boot"
version = "0.0.11" version = "0.0.12-SNAPSHOT"
} }
subprojects { subprojects {
......
...@@ -109,7 +109,7 @@ public class CacheConfig { ...@@ -109,7 +109,7 @@ public class CacheConfig {
} }
} }
}catch(Exception e){ }catch(Exception e){
logger.warn("", e); logger.warn("缓存备份失败", e);
} }
} }
} }
...@@ -119,12 +119,17 @@ public class CacheConfig { ...@@ -119,12 +119,17 @@ public class CacheConfig {
@Order(Ordered.LOWEST_PRECEDENCE-1) @Order(Ordered.LOWEST_PRECEDENCE-1)
public void onServerCache(){ public void onServerCache(){
try{ try{
logger.info("进来了");
// 本地缓存预热开关 : 默认关闭 // 本地缓存预热开关 : 默认关闭
if (!cacheEnable) { if (!cacheEnable) {
logger.warn("Cache preheating failed,because cacheEnable is false"); logger.warn("Cache preheating failed,because cacheEnable is false");
return; return;
} }
List<InstanceInfo> instances = eurekaClient.getApplication(appName).getInstances(); List<InstanceInfo> instances = eurekaClient.getApplication(appName).getInstances();
if (CollectionUtils.isEmpty(instances)) {
logger.warn("获取容器列表为空!");
return;
}
logger.info("container of all registered AppInfo : {}",instances); logger.info("container of all registered AppInfo : {}",instances);
List<InstanceInfo> list = instances.stream().sorted(Comparator.comparing(InstanceInfo::getLastUpdatedTimestamp).reversed()).collect(Collectors.toList()); 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);
......
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