From ed9a6112d9862aef92a345e6072ff61e7779785c Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sat, 21 Sep 2024 13:40:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=94=A8=E6=88=B7=E5=85=B3=E7=B3=BB=E5=8F=8A=E7=BE=A4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BC=93=E5=AD=98-=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=BE=A4=E7=BC=93=E5=AD=98=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/imService.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/service/imService.go b/service/imService.go index 71c21d0..eca1aed 100644 --- a/service/imService.go +++ b/service/imService.go @@ -2,7 +2,6 @@ package service import ( "errors" - "fmt" "strconv" "time" "videoplayer/dao" @@ -19,7 +18,6 @@ func CreateGeneralMessageService(from_id, to_id, msg_type, group_id int, content //判断是否是好友,判断是否存在缓存,不存在则设置缓存,存在则判断是否是好友 if worker.IsContainKey("user_"+strconv.Itoa(from_id)+"_friends") == false { //设置好友缓存 - fmt.Println("设置好友缓存:", from_id, to_id) isSuccess := SetFriendCache(from_id) //设置失败,直接查询数据库 if !isSuccess { @@ -320,6 +318,6 @@ func SetGroupCache(group_id int) bool { for _, user := range users { ids = append(ids, strconv.Itoa(user.UserID)) } - res := worker.SetRedisSet("group_"+strconv.Itoa(group_id)+"_groups", ids, time.Hour*12) + res := worker.SetRedisSet("group_"+strconv.Itoa(group_id)+"_users", ids, time.Hour*12) return res }