Handling exception: getcdv3.GetConn == nil

pull/455/head
skiffer-git 2 years ago committed by Xinwei Xiong(cubxxw-openim)
parent 389ea2c726
commit 1cbd2eed9d

@ -33,7 +33,13 @@ func TagSendMessage(operationID string, user *db.User, recvID, content string, s
msgData.SenderPlatformID = senderPlatformID
req.MsgData = &msgData
req.OperationID = operationID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, operationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
return
}
client := pbChat.NewChatClient(etcdConn)
respPb, err := client.SendMsg(context.Background(), &req)
if err != nil {

Loading…
Cancel
Save