Commit 0dd8eeac authored by hujiebin's avatar hujiebin

feat:优化socket打点

parent 2e556869
......@@ -414,17 +414,16 @@ func SendSocketMicChange(seqId string, userId uint64, micUserExternalId, txGroup
Timestamp: time.Now().UnixNano(),
User: micUserData,
}
n := 0
if buffer, err := proto.Marshal(msg); err == nil {
userIds := []uint64{userId}
var rspUids []uint64
n := 0
for {
n++
rspUids, err = multicast(userIds, MsgTypeGroupMicChange, buffer, time.Duration(10))
if n >= 3 || len(rspUids) <= 0 {
break
}
mylogrus.MyLog.Infof("grpc SendSocketMicChange send fail,seqId:%v,retry:%v,data:%v", seqId, n, *msg)
time.Sleep(time.Millisecond * 200)
}
......@@ -435,10 +434,10 @@ func SendSocketMicChange(seqId string, userId uint64, micUserExternalId, txGroup
}(userId, msg, rspUids, err)
if err != nil {
mylogrus.MyLog.Errorf("grpc SendSocketMicChange send fail")
mylogrus.MyLog.Errorf("grpc SendSocketMicChange send fail,seqId:%v,retry:%v,data:%v,err:%v", seqId, n, *msg, err)
return err
} else {
mylogrus.MyLog.Info("grpc SendSocketMicChange send success")
mylogrus.MyLog.Infof("grpc SendSocketMicChange send success,seqId:%v,retry:%v,data:%v", seqId, n, *msg)
}
} else {
return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment