From 30e40640c24f0dda9b4c068fe019c9771bd06de1 Mon Sep 17 00:00:00 2001 From: wangqing <408564126@qq.com> Date: Mon, 18 Mar 2024 09:00:40 +0800 Subject: [PATCH] fix comment cache evict --- .../java/com/luoo/comment/controller/CommentController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/luoo_comment/src/main/java/com/luoo/comment/controller/CommentController.java b/luoo_comment/src/main/java/com/luoo/comment/controller/CommentController.java index b998249..e63a0fb 100644 --- a/luoo_comment/src/main/java/com/luoo/comment/controller/CommentController.java +++ b/luoo_comment/src/main/java/com/luoo/comment/controller/CommentController.java @@ -83,6 +83,9 @@ public class CommentController extends BaseController { @Autowired private PublicationLikeDao publicationLikeDao; + @Autowired + private RabbitTemplate rabbitTemplate; + @Autowired private SensitiveWordBs sensitiveWordBs; @@ -410,7 +413,7 @@ public class CommentController extends BaseController { cacheChannel.clear(Constants.J2CACHE_REGION_JOURNAL_COMMENT_PAGE_HOT+"_"+comment.getRootJournalId()); cacheChannel.clear(Constants.J2CACHE_REGION_JOURNAL_COMMENT_PAGE_NEW+"_"+comment.getRootJournalId()); cacheChannel.evict(Constants.J2CACHE_REGION_JOURNAL_HOT_COMMENTS,comment.getRootJournalId()); - + rabbitTemplate.convertAndSend(Constants.RABBIT_MESSAGE_CLEAN_JOURANL_QUERY_PAGE,comment.getRootJournalId()); if(StringUtils.isNotEmpty(comment.getParentId())) { cacheChannel.clear(Constants.J2CACHE_REGION_JOURNAL_COMMENT_PAGE_CHILDREN+"_"+comment.getParentId()); }