mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 03:26:57 +08:00
cache
This commit is contained in:
parent
bbc3f5c19a
commit
65a4b38ee5
@ -170,11 +170,11 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
|
|||||||
cacheClient := pbCache.NewCacheClient(etcdConn)
|
cacheClient := pbCache.NewCacheClient(etcdConn)
|
||||||
cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq)
|
cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, "AddBlackUserToCache rpc call failed ", err.Error())
|
log.NewError(req.OperationID, "AddGroupMemberToCache rpc call failed ", err.Error())
|
||||||
return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil
|
return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil
|
||||||
}
|
}
|
||||||
if cacheResp.CommonResp.ErrCode != 0 {
|
if cacheResp.CommonResp.ErrCode != 0 {
|
||||||
log.NewError(req.OperationID, "AddBlackUserToCache rpc logic call failed ", cacheResp.String())
|
log.NewError(req.OperationID, "AddGroupMemberToCache rpc logic call failed ", cacheResp.String())
|
||||||
return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil
|
return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,11 +334,11 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
|||||||
cacheClient := pbCache.NewCacheClient(etcdConn)
|
cacheClient := pbCache.NewCacheClient(etcdConn)
|
||||||
cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq)
|
cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, "AddBlackUserToCache rpc call failed ", err.Error())
|
log.NewError(req.OperationID, "AddGroupMemberToCache rpc call failed ", err.Error())
|
||||||
return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil
|
return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil
|
||||||
}
|
}
|
||||||
if cacheResp.CommonResp.ErrCode != 0 {
|
if cacheResp.CommonResp.ErrCode != 0 {
|
||||||
log.NewError(req.OperationID, "AddBlackUserToCache rpc logic call failed ", cacheResp.String())
|
log.NewError(req.OperationID, "AddGroupMemberToCache rpc logic call failed ", cacheResp.String())
|
||||||
return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil
|
return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
pbCache "Open_IM/pkg/proto/cache"
|
pbCache "Open_IM/pkg/proto/cache"
|
||||||
pbChat "Open_IM/pkg/proto/chat"
|
pbChat "Open_IM/pkg/proto/chat"
|
||||||
pbConversation "Open_IM/pkg/proto/conversation"
|
pbConversation "Open_IM/pkg/proto/conversation"
|
||||||
pbGroup "Open_IM/pkg/proto/group"
|
|
||||||
sdk_ws "Open_IM/pkg/proto/sdk_ws"
|
sdk_ws "Open_IM/pkg/proto/sdk_ws"
|
||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
"context"
|
"context"
|
||||||
@ -217,21 +216,6 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S
|
|||||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg result", canSend, "end rpc and return")
|
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg result", canSend, "end rpc and return")
|
||||||
return returnMsg(&replay, pb, 201, "callbackBeforeSendGroupMsg result stop rpc and return", "", 0)
|
return returnMsg(&replay, pb, 201, "callbackBeforeSendGroupMsg result stop rpc and return", "", 0)
|
||||||
}
|
}
|
||||||
//etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName)
|
|
||||||
//client := pbGroup.NewGroupClient(etcdConn)
|
|
||||||
//req := &pbGroup.GetGroupAllMemberReq{
|
|
||||||
// GroupID: pb.MsgData.GroupID,
|
|
||||||
// OperationID: pb.OperationID,
|
|
||||||
//}
|
|
||||||
//reply, err := client.GetGroupAllMember(context.Background(), req)
|
|
||||||
//if err != nil {
|
|
||||||
// log.Error(pb.Token, pb.OperationID, "rpc send_msg getGroupInfo failed, err = %s", err.Error())
|
|
||||||
// return returnMsg(&replay, pb, 201, err.Error(), "", 0)
|
|
||||||
//}
|
|
||||||
//if reply.ErrCode != 0 {
|
|
||||||
// log.Error(pb.Token, pb.OperationID, "rpc send_msg getGroupInfo failed, err = %s", reply.ErrMsg)
|
|
||||||
// return returnMsg(&replay, pb, reply.ErrCode, reply.ErrMsg, "", 0)
|
|
||||||
//}
|
|
||||||
getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pb.OperationID, GroupID: pb.MsgData.GroupID}
|
getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pb.OperationID, GroupID: pb.MsgData.GroupID}
|
||||||
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName)
|
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName)
|
||||||
client := pbCache.NewCacheClient(etcdConn)
|
client := pbCache.NewCacheClient(etcdConn)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user