Handling exception: getcdv3.GetConn == nil

pull/236/head
skiffer-git 2 years ago
parent 90442e3e39
commit 56cf46a3a4

@ -51,7 +51,13 @@ func PullMsgBySeqList(c *gin.Context) {
pbData.OperationID = params.OperationID
pbData.SeqList = params.SeqList
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, pbData.OperationID)
if grpcConn == nil {
errMsg := pbData.OperationID + "getcdv3.GetConn == nil"
log.NewError(pbData.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
msgClient := pbChat.NewChatClient(grpcConn)
reply, err := msgClient.PullMessageBySeqList(context.Background(), &pbData)
if err != nil {

Loading…
Cancel
Save