Commit db2fb43c authored by hujiebin's avatar hujiebin

feat:重试3次

parent 525f7b31
......@@ -415,7 +415,17 @@ func SendSocketMicChange(seqId string, userId uint64, micUserExternalId, txGroup
}
if buffer, err := proto.Marshal(msg); err == nil {
userIds := []uint64{userId}
rspUids, err := multicast(userIds, MsgTypeGroupMicChange, buffer)
var rspUids []uint64
n := 0
for {
n++
rspUids, err = multicast(userIds, MsgTypeGroupMicChange, buffer)
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)
}
//记录socket,注意闭包问题
go func(userIds []uint64, msg *userProxy.GroupMicChange, rspUids []uint64, err error) {
......
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