mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 13:12:12 +08:00
fix: err
This commit is contained in:
parent
fc6619497c
commit
6952c4b1b3
@ -18,7 +18,6 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@ -132,7 +131,7 @@ func (c *Client) readMessage() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
c.closedErr = ErrPanic
|
||||
fmt.Println("socket have panic err:", r, string(debug.Stack()))
|
||||
log.ZPanic(c.ctx, "socket have panic err:", r)
|
||||
}
|
||||
c.close()
|
||||
}()
|
||||
|
||||
@ -115,8 +115,8 @@ type GrpcHandler struct {
|
||||
validate *validator.Validate
|
||||
}
|
||||
|
||||
func NewGrpcHandler() *GrpcHandler {
|
||||
return &GrpcHandler{}
|
||||
func NewGrpcHandler(validate *validator.Validate) *GrpcHandler {
|
||||
return &GrpcHandler{validate: validate}
|
||||
}
|
||||
|
||||
func (g GrpcHandler) GetSeq(ctx context.Context, data *Req) ([]byte, error) {
|
||||
|
||||
@ -70,7 +70,7 @@ type kickHandler struct {
|
||||
}
|
||||
|
||||
func (ws *WsServer) SetDiscoveryRegistry(disCov discovery.SvcDiscoveryRegistry, config *Config) {
|
||||
ws.MessageHandler = NewGrpcHandler()
|
||||
ws.MessageHandler = NewGrpcHandler(ws.validate)
|
||||
ws.disCov = disCov
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user