From a6f30db53b15831b158b4ab8487efc8d54549c66 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 18 Apr 2023 18:10:58 +0800 Subject: [PATCH] group --- pkg/common/db/controller/group.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/common/db/controller/group.go b/pkg/common/db/controller/group.go index 8e8033722..6aced79dc 100644 --- a/pkg/common/db/controller/group.go +++ b/pkg/common/db/controller/group.go @@ -11,7 +11,6 @@ import ( unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/tx" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/log" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils" "github.com/dtm-labs/rockscache" "github.com/go-redis/redis/v8" @@ -123,16 +122,14 @@ func (g *groupDatabase) CreateGroup(ctx context.Context, groups []*relationTb.Gr } m := make(map[string]struct{}) var cache = g.cache.NewCache() - log.ZDebug(ctx, "CreateGroup", "groupMembers", groupMembers) for _, groupMember := range groupMembers { if _, ok := m[groupMember.GroupID]; !ok { - log.ZDebug(ctx, "CreateGroup", "groupMember", groupMember) m[groupMember.GroupID] = struct{}{} - cache = cache.DelGroupMemberIDs(groupMember.GroupID).DelGroupMembersHash(groupMember.GroupID).DelJoinedGroupID(groupMember.UserID).DelGroupsMemberNum(groupMember.GroupID) + cache = cache.DelGroupMemberIDs(groupMember.GroupID).DelGroupMembersHash(groupMember.GroupID).DelGroupsMemberNum(groupMember.GroupID) } + cache.DelJoinedGroupID(groupMember.UserID) } - log.ZDebug(ctx, "CreateGroup", "keys", cache.GetPreDelKeys()) - return g.cache.ExecDel(ctx) + return cache.ExecDel(ctx) }) }