From 5afc9e05ca10fb01d843c225b26ad82dd860ab68 Mon Sep 17 00:00:00 2001 From: why2go Date: Tue, 6 Jun 2023 22:46:48 +0800 Subject: [PATCH] bug fix --- 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 {