From 0f085f5b1ec20e4c149eee5649cdb46b8691f47a Mon Sep 17 00:00:00 2001 From: liusiyuan <945212191@qq.com> Date: Fri, 27 Jan 2023 10:16:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E8=AE=B0=E5=BD=95=E4=B8=BA=E7=A9=BA=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=94=A8=E6=88=B7=E6=88=90=E5=B0=B1=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/comment/service/internal/data/comment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/comment/service/internal/data/comment.go b/app/comment/service/internal/data/comment.go index e368d0eb..a8b117b3 100644 --- a/app/comment/service/internal/data/comment.go +++ b/app/comment/service/internal/data/comment.go @@ -184,7 +184,7 @@ func (r *commentRepo) getCommentUserFromCache(ctx context.Context, key string) ( func (r *commentRepo) getCommentUserFromDB(ctx context.Context, uuid string) (*biz.CommentUser, error) { cu := &CommentUser{} err := r.data.db.WithContext(ctx).Select("comment", "article_reply", "article_reply_sub", "talk_reply", "talk_reply_sub", "article_replied", "article_replied_sub", "talk_replied", "talk_replied_sub").Where("uuid = ?", uuid).First(cu).Error - if err != nil { + if !errors.Is(err, gorm.ErrRecordNotFound) && err != nil { return nil, errors.Wrapf(err, fmt.Sprintf("faile to get comment user from db: uuid(%v)", uuid)) } return &biz.CommentUser{