From db2fb43cccf5a92736ed7bfd8243e5f53835d5fb Mon Sep 17 00:00:00 2001 From: hujiebin Date: Wed, 26 Jul 2023 14:38:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=87=8D=E8=AF=953=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc/user_center_func.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rpc/user_center_func.go b/rpc/user_center_func.go index 3ae5042..848ec00 100644 --- a/rpc/user_center_func.go +++ b/rpc/user_center_func.go @@ -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) { -- 2.22.0