From 58ce721674ab0a5b2b48b914f1d7c841633a0709 Mon Sep 17 00:00:00 2001 From: paulGao Date: Wed, 3 Nov 2021 15:25:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0es=E5=BC=82=E5=B8=B8=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/search/serviceimpl/EsGoodsIndexServiceImpl.java | 4 +++- .../cn/lili/controller/other/ElasticsearchController.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java index 65b3254a..3f8fdfd0 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java @@ -542,8 +542,10 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements goodsWords.setSort(0); goodsWordsService.save(goodsWords); } - } catch (MyBatisSystemException e) { + } catch (MyBatisSystemException me) { log.error(words + "关键字已存在!"); + } catch (Exception e) { + log.error("关键字入库异常!", e); } } diff --git a/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java b/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java index 4770c933..a4cac7dc 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java @@ -26,6 +26,7 @@ import cn.lili.modules.store.entity.dos.StoreGoodsLabel; import cn.lili.modules.store.service.StoreGoodsLabelService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import io.swagger.annotations.Api; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.web.bind.annotation.GetMapping; @@ -47,6 +48,7 @@ import java.util.Map; @RestController @Api(tags = "ES初始化接口") @RequestMapping("/manager/elasticsearch") +@Slf4j public class ElasticsearchController { @Autowired @@ -133,6 +135,7 @@ public class ElasticsearchController { } catch (Exception e) { cache.put(CachePrefix.INIT_INDEX_PROCESS.getPrefix(), null); cache.put(CachePrefix.INIT_INDEX_FLAG.getPrefix(), false); + log.error("初始化索引异常", e); } }); return ResultUtil.success();