Commit 24076df5 authored by tangwei's avatar tangwei

修改代码检测错误

parent 30de84de
......@@ -17,6 +17,7 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
......@@ -53,9 +54,8 @@ public class AmosJcsApplication {
String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
GlobalExceptionHandler.setAlwaysOk(true);
logger.info("\n----------------------------------------------------------\n\t"
+ "Application Amos-Biz-Boot is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port
+ path + "/doc.html\n" + "----------------------------------------------------------");
String logs=String.format("%n----------------------------------------------------------%n Application Amos-Biz-Boot is running! Access URLs:%n Swagger文档: http:// %c : %c %c /doc.html%n----------------------------------------------------------",ip,port,path);
logger.info( logs);
}
/**
......@@ -71,12 +71,18 @@ public class AmosJcsApplication {
RedisTemplate redisTemplate = context.getBean("redisTemplate", RedisTemplate.class);
RedisConnection redisConnection = null;
try {
redisConnection = redisTemplate.getConnectionFactory().getConnection();
redisConnection.flushAll();
RedisConnectionFactory redisConnectionFactory=redisTemplate.getConnectionFactory();
if(redisConnectionFactory!=null){
redisConnection = redisConnectionFactory.getConnection();
redisConnection.flushAll();
}
} catch (Exception e) {
logger.info("删除redis 缓存的key 失败");
} finally {
redisConnection.close();
if(redisConnection!=null){
redisConnection.close();
}
}
}
......
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