大赛管理功能
This commit is contained in:
parent
cc7218902e
commit
6843a987d5
|
@ -117,13 +117,13 @@ public class MapService implements IMapService, ApplicationRunner {
|
|||
public void run(ApplicationArguments args) throws Exception {
|
||||
//缓存所有地图数据
|
||||
log.info("开始缓存地图数据");
|
||||
/* for (MapVO mapVO : listOnline()) {
|
||||
try {
|
||||
getMapDetail(mapVO.getId());
|
||||
} catch (Exception e) {
|
||||
log.error(String.format("[id:%s]的地图缓存失败", mapVO.getId()), e);
|
||||
}
|
||||
}*/
|
||||
for (MapVO mapVO : listOnline()) {
|
||||
try {
|
||||
getMapDetail(mapVO.getId());
|
||||
} catch (Exception e) {
|
||||
log.error(String.format("[id:%s]的地图缓存失败", mapVO.getId()), e);
|
||||
}
|
||||
}
|
||||
log.info("缓存地图数据结束");
|
||||
}
|
||||
|
||||
|
@ -256,9 +256,9 @@ public class MapService implements IMapService, ApplicationRunner {
|
|||
@Override
|
||||
public MapVO getMapDetail(Long id) {
|
||||
Objects.requireNonNull(id, "id不能为空");
|
||||
if (id < 0) {
|
||||
return null;
|
||||
}
|
||||
if (id < 0) {
|
||||
return null;
|
||||
}
|
||||
MapVO mapVO = (MapVO) this.iCacheService.get(BusinessConsts.CachePrefix.Map + id);
|
||||
if (Objects.isNull(mapVO)) { // 缓存不存在,查询数据库
|
||||
synchronized (this) {
|
||||
|
|
Loading…
Reference in New Issue