Commit 0dd8eeac authored by hujiebin's avatar hujiebin

feat:优化socket打点

parent 2e556869
...@@ -414,17 +414,16 @@ func SendSocketMicChange(seqId string, userId uint64, micUserExternalId, txGroup ...@@ -414,17 +414,16 @@ func SendSocketMicChange(seqId string, userId uint64, micUserExternalId, txGroup
Timestamp: time.Now().UnixNano(), Timestamp: time.Now().UnixNano(),
User: micUserData, User: micUserData,
} }
n := 0
if buffer, err := proto.Marshal(msg); err == nil { if buffer, err := proto.Marshal(msg); err == nil {
userIds := []uint64{userId} userIds := []uint64{userId}
var rspUids []uint64 var rspUids []uint64
n := 0
for { for {
n++ n++
rspUids, err = multicast(userIds, MsgTypeGroupMicChange, buffer, time.Duration(10)) rspUids, err = multicast(userIds, MsgTypeGroupMicChange, buffer, time.Duration(10))
if n >= 3 || len(rspUids) <= 0 { if n >= 3 || len(rspUids) <= 0 {
break break
} }
mylogrus.MyLog.Infof("grpc SendSocketMicChange send fail,seqId:%v,retry:%v,data:%v", seqId, n, *msg)
time.Sleep(time.Millisecond * 200) time.Sleep(time.Millisecond * 200)
} }
...@@ -435,10 +434,10 @@ func SendSocketMicChange(seqId string, userId uint64, micUserExternalId, txGroup ...@@ -435,10 +434,10 @@ func SendSocketMicChange(seqId string, userId uint64, micUserExternalId, txGroup
}(userId, msg, rspUids, err) }(userId, msg, rspUids, err)
if err != nil { 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 return err
} else { } 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 { } else {
return err 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