Commit c5174cfe authored by caotao's avatar caotao

1.取缓存数据优化

parent 0e9616bc
......@@ -254,14 +254,15 @@ public class CommonServiceImpl {
public List<StationCacheInfoDto> getListStationCacheInfoDto(){
List<StationCacheInfoDto> stationCacheInfoDtoList =redisTemplate.opsForList().range("station_info_cache",0,-1);
if(stationCacheInfoDtoList!=null){
if(ObjectUtils.isEmpty(stationCacheInfoDtoList)){
try {
stationCacheDataInit.run();
stationCacheInfoDtoList =redisTemplate.opsForList().range("station_info_cache",0,-1);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
stationCacheInfoDtoList =redisTemplate.opsForList().range("station_info_cache",0,-1);
return stationCacheInfoDtoList;
}
}
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