From 6843a987d58fe095d54e1222fa512d2f0b4de542 Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Mon, 11 Mar 2024 13:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E8=B5=9B=E7=AE=A1=E7=90=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/rtss/services/MapService.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/MapService.java b/src/main/java/club/joylink/rtss/services/MapService.java index c660bcda8..87cb7d845 100644 --- a/src/main/java/club/joylink/rtss/services/MapService.java +++ b/src/main/java/club/joylink/rtss/services/MapService.java @@ -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) {