conversation

test-errcode
wangchuxiao 2 years ago
parent d9afe8a562
commit 8a073a9dfb

@ -2,6 +2,8 @@ package group
import (
"context"
"time"
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
"github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
@ -12,7 +14,6 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/group"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
"time"
)
func CallbackBeforeCreateGroup(ctx context.Context, req *group.CreateGroupReq) (err error) {

@ -68,12 +68,16 @@ func (c *ConversationDataBase) SetUsersConversationFiledTx(ctx context.Context,
temp.OwnerUserID = v
cList = append(cList, temp)
}
err = conversationTx.Create(ctx, cList)
if err != nil {
return err
cache := c.cache.NewCache()
if len(cList) > 0 {
err = conversationTx.Create(ctx, cList)
if err != nil {
return err
}
cache = cache.DelConversationIDs(NotUserIDs)
}
// clear cache
return c.cache.DelConversationIDs(NotUserIDs).DelUsersConversation(haveUserIDs, conversation.ConversationID).ExecDel(ctx)
return cache.DelUsersConversation(haveUserIDs, conversation.ConversationID).ExecDel(ctx)
})
}

Loading…
Cancel
Save