Handling exception: getcdv3.GetConn == nil

This commit is contained in:
skiffer-git 2022-06-16 14:36:59 +08:00
parent 50df9bdf4e
commit 066a7041d8

View File

@ -147,7 +147,13 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush) isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush)
log.Debug(pushMsg.OperationID, "Get super group msg from msg_transfer And push msg", pushMsg.String()) log.Debug(pushMsg.OperationID, "Get super group msg from msg_transfer And push msg", pushMsg.String())
getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pushMsg.OperationID, GroupID: pushMsg.MsgData.GroupID} getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pushMsg.OperationID, GroupID: pushMsg.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, pushMsg.OperationID)
if etcdConn == nil {
errMsg := pushMsg.OperationID + "getcdv3.GetConn == nil"
log.NewError(pushMsg.OperationID, errMsg)
return
}
client := pbCache.NewCacheClient(etcdConn) client := pbCache.NewCacheClient(etcdConn)
cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq)
if err != nil { if err != nil {