From 24f2ffe82d6806f3e4470e6a99de3b5eea4a292c Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Thu, 16 Jun 2022 15:21:53 +0800 Subject: [PATCH] Handling exception: getcdv3.GetConn == nil --- internal/rpc/office/office.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index b75c97edd..71a6db68b 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -205,7 +205,15 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR } var groupUserIDList []string for _, groupID := range req.GroupList { - 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, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + resp.CommonResp.ErrCode = constant.ErrInternal.ErrCode + resp.CommonResp.ErrMsg = errMsg + return resp, nil + } + cacheClient := pbCache.NewCacheClient(etcdConn) req := pbCache.GetGroupMemberIDListFromCacheReq{ OperationID: req.OperationID,