ws
CI / changes (push) Successful in 1m29s
CI / ad (push) Successful in 0s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 35s
CI / chore (push) Successful in 1s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 0s
CI / factory (push) Successful in 1s
CI / message (push) Successful in 0s
CI / order (push) Successful in 0s
CI / payment (push) Successful in 1s
CI / percutaneous (push) Successful in 21s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / support (push) Successful in 0s
CI / user (push) Successful in 0s
CI / task (push) Successful in 0s
CI / wecom (push) Successful in 0s

This commit is contained in:
2026-10-08 17:53:16 +08:00
parent 93f7b46073
commit 9260e75aa4
2 changed files with 0 additions and 14 deletions
@@ -48,7 +48,6 @@ func NewWsAddUserStreamLogic(ctx context.Context, svcCtx *svc.ServiceContext) *W
// 添加用户
func (l *WsAddUserStreamLogic) WsAddUserStream(stream percutaneous.Percutaneous_WsAddUserStreamServer) error {
l.Logger.Info("in coming ws tunnel stream")
ctx := stream.Context()
timeout := time.Duration(utils.GetConfigInt("ws.out_time")) * time.Second
ctx, cancel := context.WithTimeout(ctx, timeout)
@@ -65,12 +64,10 @@ func (l *WsAddUserStreamLogic) WsAddUserStream(stream percutaneous.Percutaneous_
var hostCode struct {
Code string `json:"host_code"`
}
l.Logger.Errorf(" host_code raw msg is: %v", string(recvFrame.RawBody))
// 保留你确认的 !err 判断
if ok := utils.JsonStringToStruct(string(recvFrame.RawBody), &hostCode); !ok {
return status.Errorf(codes.InvalidArgument, "device code parse error")
}
l.Logger.Infof("device connected, code=%s", hostCode.Code)
msgCh := make(chan []byte, 1)
wrapper := &grpcStreamWrapper{stream: stream}
@@ -82,7 +79,6 @@ func (l *WsAddUserStreamLogic) WsAddUserStream(stream percutaneous.Percutaneous_
}
l.svcCtx.SessionMgr.Register(hostCode.Code, sess)
defer l.svcCtx.SessionMgr.Remove(hostCode.Code)
l.Logger.Info("session register success, waiting for scan event")
select {
case <-ctx.Done():