This commit is contained in:
Gordon
2022-02-25 19:49:38 +08:00
parent 4f01b0b2ad
commit 2775d9b78a
4 changed files with 10 additions and 12 deletions
+4
View File
@@ -3,6 +3,8 @@ package gate
import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/statistics"
"fmt"
"github.com/go-playground/validator/v10"
"sync"
)
@@ -12,6 +14,7 @@ var (
validate *validator.Validate
ws WServer
rpcSvr RPCServer
count uint64
)
func Init(rpcPort, wsPort int) {
@@ -19,6 +22,7 @@ func Init(rpcPort, wsPort int) {
log.NewPrivateLog(config.Config.ModuleName.LongConnSvrName)
rwLock = new(sync.RWMutex)
validate = validator.New()
statistics.NewStatistics(&count, config.Config.ModuleName.LongConnSvrName, fmt.Sprintf("%d second recv to msg_gateway count", count), 10)
ws.onInit(wsPort)
rpcSvr.onInit(rpcPort)
}
+1
View File
@@ -142,6 +142,7 @@ func (ws *WServer) pullMsgBySeqListResp(conn *UserConn, m *Req, pb *sdk_ws.PullM
}
func (ws *WServer) sendMsgReq(conn *UserConn, m *Req) {
count++
log.NewInfo(m.OperationID, "Ws call success to sendMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID)
nReply := new(pbChat.SendMsgResp)
isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendMsg)