mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 20:30:40 +08:00
Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun
This commit is contained in:
commit
3f76521bfe
@ -164,7 +164,7 @@ func (och *OnlineHistoryConsumerHandler) SendMessageToMongoCH(userID string, tri
|
|||||||
func (och *OnlineHistoryConsumerHandler) MongoMessageRun(channelID int) {
|
func (och *OnlineHistoryConsumerHandler) MongoMessageRun(channelID int) {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case cmd := <-och.chArrays[channelID]:
|
case cmd := <-och.chMongoArrays[channelID]:
|
||||||
switch cmd.Cmd {
|
switch cmd.Cmd {
|
||||||
case MongoMessages:
|
case MongoMessages:
|
||||||
msgChannelValue := cmd.Value.(MsgChannelValue)
|
msgChannelValue := cmd.Value.(MsgChannelValue)
|
||||||
|
@ -17,6 +17,7 @@ import (
|
|||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"google.golang.org/grpc"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -32,11 +33,16 @@ type AtContent struct {
|
|||||||
IsAtSelf bool `json:"isAtSelf"`
|
IsAtSelf bool `json:"isAtSelf"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var grpcCons []*grpc.ClientConn
|
||||||
|
|
||||||
func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
||||||
var wsResult []*pbRelay.SingleMsgToUser
|
var wsResult []*pbRelay.SingleMsgToUser
|
||||||
isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush)
|
isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush)
|
||||||
log.Debug(pushMsg.OperationID, "Get msg from msg_transfer And push msg", pushMsg.String())
|
log.Debug(pushMsg.OperationID, "Get msg from msg_transfer And push msg", pushMsg.String())
|
||||||
grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName)
|
if len(grpcCons) == 0 {
|
||||||
|
log.NewWarn(pushMsg.OperationID, "first GetConn4Unique ")
|
||||||
|
grpcCons = getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName)
|
||||||
|
}
|
||||||
//Online push message
|
//Online push message
|
||||||
log.Debug("test", pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String())
|
log.Debug("test", pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String())
|
||||||
for _, v := range grpcCons {
|
for _, v := range grpcCons {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user