优化更新商品索引促销信息时为异步执行。

This commit is contained in:
paulGao 2021-12-28 19:59:52 +08:00
parent 4d49d3c77a
commit c65fd99b15

View File

@ -2,6 +2,7 @@ package cn.lili.listener;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ClassLoaderUtil;
import cn.hutool.json.JSONObject;
@ -140,7 +141,7 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
}
break;
case UPDATE_GOODS_INDEX_PROMOTIONS:
this.updateGoodsIndexPromotions(new String(messageExt.getBody()));
ThreadUtil.execAsync(() -> this.updateGoodsIndexPromotions(new String(messageExt.getBody())));
break;
case DELETE_GOODS_INDEX_PROMOTIONS:
BasePromotions promotions = JSONUtil.toBean(new String(messageExt.getBody()), BasePromotions.class);