feat: retry add ice 3 times

pull/1/head
Benyamin Azarkhazin 2023-08-24 18:01:10 +03:30
parent df92d0ec0a
commit cc178b1ebd
Signed by: benyamin
GPG Key ID: 3AE44F5623C70269
1 changed files with 10 additions and 0 deletions

View File

@ -53,7 +53,17 @@ func (c *RoomController) AddICECandidate(ctx *gin.Context) {
c.helper.ResponseUnprocessableEntity(ctx)
return
}
tryCounter := 0
start:
err := c.repo.AddPeerIceCandidate(reqModel.RoomId, reqModel.ID, reqModel.ICECandidate)
if err != nil {
if tryCounter < 4 {
time.Sleep(1 * time.Second)
tryCounter++
goto start
}
}
if c.helper.HandleIfErr(ctx, err, nil) {
return
}