mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-08 11:38:54 +08:00
msg rpc max
This commit is contained in:
parent
271934ef4b
commit
19da03dfa4
@ -15,10 +15,12 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"github.com/gorilla/websocket"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
"github.com/gorilla/websocket"
|
||||||
|
"google.golang.org/grpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) {
|
func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) {
|
||||||
@ -150,7 +152,8 @@ func (ws *WServer) pullMsgBySeqListReq(conn *UserConn, m *Req) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
msgClient := pbChat.NewMsgClient(grpcConn)
|
msgClient := pbChat.NewMsgClient(grpcConn)
|
||||||
reply, err := msgClient.PullMessageBySeqList(context.Background(), &rpcReq)
|
maxSizeOption := grpc.MaxCallRecvMsgSize(1024 * 1024 * 20)
|
||||||
|
reply, err := msgClient.PullMessageBySeqList(context.Background(), &rpcReq, maxSizeOption)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(rpcReq.OperationID, "pullMsgBySeqListReq err", err.Error())
|
log.NewError(rpcReq.OperationID, "pullMsgBySeqListReq err", err.Error())
|
||||||
nReply.ErrCode = 200
|
nReply.ErrCode = 200
|
||||||
|
@ -10,11 +10,12 @@ import (
|
|||||||
"Open_IM/pkg/grpc-etcdv3/getcdv3"
|
"Open_IM/pkg/grpc-etcdv3/getcdv3"
|
||||||
"Open_IM/pkg/proto/msg"
|
"Open_IM/pkg/proto/msg"
|
||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
|
||||||
grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
@ -94,8 +95,12 @@ func (rpc *rpcChat) Run() {
|
|||||||
panic("listening err:" + err.Error() + rpc.rpcRegisterName)
|
panic("listening err:" + err.Error() + rpc.rpcRegisterName)
|
||||||
}
|
}
|
||||||
log.Info("", "listen network success, address ", address)
|
log.Info("", "listen network success, address ", address)
|
||||||
|
recvSize := 1024 * 1024 * 30
|
||||||
var grpcOpts []grpc.ServerOption
|
sendSize := 1024 * 1024 * 30
|
||||||
|
var grpcOpts = []grpc.ServerOption{
|
||||||
|
grpc.MaxRecvMsgSize(recvSize),
|
||||||
|
grpc.MaxSendMsgSize(sendSize),
|
||||||
|
}
|
||||||
if config.Config.Prometheus.Enable {
|
if config.Config.Prometheus.Enable {
|
||||||
promePkg.NewGrpcRequestCounter()
|
promePkg.NewGrpcRequestCounter()
|
||||||
promePkg.NewGrpcRequestFailedCounter()
|
promePkg.NewGrpcRequestFailedCounter()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user