From 24286c355b363dc109c5154c5ac14251eb7e7be9 Mon Sep 17 00:00:00 2001 From: why2go Date: Wed, 7 Jun 2023 22:30:35 +0800 Subject: [PATCH] fix: fix wrong condition judgement Signed-off-by: why2go --- internal/msg_transfer/logic/online_history_msg_handler.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/msg_transfer/logic/online_history_msg_handler.go b/internal/msg_transfer/logic/online_history_msg_handler.go index 26c0da5f4..96d506207 100644 --- a/internal/msg_transfer/logic/online_history_msg_handler.go +++ b/internal/msg_transfer/logic/online_history_msg_handler.go @@ -11,12 +11,13 @@ import ( pbPush "Open_IM/pkg/proto/push" "Open_IM/pkg/utils" "context" - "github.com/Shopify/sarama" - "github.com/golang/protobuf/proto" "hash/crc32" "strings" "sync" "time" + + "github.com/Shopify/sarama" + "github.com/golang/protobuf/proto" ) type MsgChannelValue struct { @@ -529,7 +530,7 @@ func sendMessageToPush(message *pbMsg.MsgDataToMQ, pushToUserID string) { rpcPushMsg := pbPush.PushMsgReq{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} mqPushMsg := pbMsg.PushMsgDataToMQ{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName, message.OperationID) - if grpcConn != nil { + if grpcConn == nil { log.Error(rpcPushMsg.OperationID, "rpc dial failed", "push data", rpcPushMsg.String()) pid, offset, err := producer.SendMessage(&mqPushMsg, mqPushMsg.PushToUserID, rpcPushMsg.OperationID) if err != nil {