mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup
This commit is contained in:
commit
e95f09191a
@ -38,6 +38,7 @@ func (r *RPCServer) GetSingleUserMsgForPushPlatforms(operationID string, msgData
|
||||
user2PushMsg := make(map[int][]*sdk_ws.MsgData, 0)
|
||||
for _, v := range platformIDList {
|
||||
user2PushMsg[v] = r.GetSingleUserMsgForPush(operationID, msgData, pushToUserID, v)
|
||||
log.Info(operationID, "GetSingleUserMsgForPush", msgData.Seq, pushToUserID, v, "len:", len(user2PushMsg[v]))
|
||||
}
|
||||
return user2PushMsg
|
||||
}
|
||||
|
@ -205,15 +205,18 @@ func (r *RPCServer) OnlineBatchPushOneMsg(_ context.Context, req *pbRelay.Online
|
||||
for k, _ := range userConnMap {
|
||||
platformList = append(platformList, k)
|
||||
}
|
||||
log.Debug(req.OperationID, "GetSingleUserMsgForPushPlatforms begin", req.MsgData.Seq, v, platformList)
|
||||
needPushMapList := r.GetSingleUserMsgForPushPlatforms(req.OperationID, req.MsgData, v, platformList)
|
||||
log.Debug(req.OperationID, "GetSingleUserMsgForPushPlatforms ", req.MsgData.Seq, v, platformList, len(needPushMapList))
|
||||
for platform, list := range needPushMapList {
|
||||
if list != nil {
|
||||
log.Debug(req.OperationID, "GetSingleUserMsgForPushPlatforms ", "userID: ", v, "platform: ", platform, "push msg num:", len(list))
|
||||
for _, v := range list {
|
||||
req.MsgData.MsgDataList = append(req.MsgData.MsgDataList, v)
|
||||
}
|
||||
replyBytes, err := r.encodeWsData(req.MsgData, req.OperationID)
|
||||
if err != nil {
|
||||
log.Error(req.OperationID, "encodeWsData failed ", req.MsgData.String())
|
||||
continue
|
||||
}
|
||||
resultCode := sendMsgBatchToUser(userConnMap[platform], replyBytes.Bytes(), req, platform, v)
|
||||
@ -227,7 +230,6 @@ func (r *RPCServer) OnlineBatchPushOneMsg(_ context.Context, req *pbRelay.Online
|
||||
}
|
||||
resp = append(resp, temp)
|
||||
}
|
||||
|
||||
} else {
|
||||
if utils.IsContainInt(platform, r.pushTerminal) {
|
||||
tempT.OnlinePush = true
|
||||
|
@ -50,7 +50,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
||||
log.Debug("test", pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String())
|
||||
for _, v := range grpcCons {
|
||||
msgClient := pbRelay.NewOnlineMessageRelayServiceClient(v)
|
||||
reply, err := msgClient.SuperGroupOnlineBatchPushOneMsg(context.Background(), &pbRelay.OnlineBatchPushOneMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserIDList: []string{pushMsg.PushToUserID}})
|
||||
reply, err := msgClient.OnlineBatchPushOneMsg(context.Background(), &pbRelay.OnlineBatchPushOneMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserIDList: []string{pushMsg.PushToUserID}})
|
||||
if err != nil {
|
||||
log.NewError("push data to client rpc err", pushMsg.OperationID, "err", err)
|
||||
continue
|
||||
|
@ -18,12 +18,12 @@ import (
|
||||
pbUser "Open_IM/pkg/proto/user"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"google.golang.org/grpc"
|
||||
"math/big"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type groupServer struct {
|
||||
@ -96,7 +96,10 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
|
||||
|
||||
groupId := req.GroupInfo.GroupID
|
||||
if groupId == "" {
|
||||
groupId = utils.Md5(strconv.FormatInt(time.Now().UnixNano(), 10))
|
||||
groupId = utils.Md5(req.OperationID + strconv.FormatInt(time.Now().UnixNano(), 10))
|
||||
bi := big.NewInt(0)
|
||||
bi.SetString(groupId[0:8], 16)
|
||||
groupId = bi.String()
|
||||
}
|
||||
//to group
|
||||
groupInfo := db.Group{}
|
||||
|
62
script/batch_build_all_service.sh
Normal file
62
script/batch_build_all_service.sh
Normal file
@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ./style_info.cfg
|
||||
source ./path_info.cfg
|
||||
source ./function.sh
|
||||
|
||||
bin_dir="../bin"
|
||||
logs_dir="../logs"
|
||||
sdk_db_dir="../db/sdk/"
|
||||
#Automatically created when there is no bin, logs folder
|
||||
if [ ! -d $bin_dir ]; then
|
||||
mkdir -p $bin_dir
|
||||
fi
|
||||
if [ ! -d $logs_dir ]; then
|
||||
mkdir -p $logs_dir
|
||||
fi
|
||||
if [ ! -d $sdk_db_dir ]; then
|
||||
mkdir -p $sdk_db_dir
|
||||
fi
|
||||
|
||||
#begin path
|
||||
begin_path=$PWD
|
||||
|
||||
|
||||
build_pid_array=()
|
||||
|
||||
for ((i = 0; i < ${#service_source_root[*]}; i++)); do
|
||||
cd $begin_path
|
||||
service_path=${service_source_root[$i]}
|
||||
cd $service_path
|
||||
make install > /dev/null &
|
||||
build_pid=$!
|
||||
build_pid_array[i]=$build_pid
|
||||
done
|
||||
|
||||
|
||||
echo "wait all build finish....."
|
||||
|
||||
success_num=0
|
||||
for ((i = 0; i < ${#service_source_root[*]}; i++)); do
|
||||
echo "wait pid: " ${build_pid_array[i]} ${service_names[$i]}
|
||||
wait ${build_pid_array[i]}
|
||||
stat=$?
|
||||
echo ${build_pid_array[i]} " " $stat
|
||||
if [ $stat == 0 ]
|
||||
then
|
||||
echo -e "${GREEN_PREFIX}${service_names[$i]} successfully be built ${COLOR_SUFFIX}\n"
|
||||
success_num=$success_num+1
|
||||
|
||||
else
|
||||
echo -e "${RED_PREFIX}${service_names[$i]} build failed ${COLOR_SUFFIX}\n"
|
||||
exit -1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "success_num" $success_num
|
||||
echo "service_source_root" ${#service_source_root[*]}
|
||||
|
||||
if [ $success_num == ${#service_source_root[*]} ]
|
||||
then
|
||||
echo -e ${YELLOW_PREFIX}"all services build success"${COLOR_SUFFIX}
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user