feat: retry add ice 3 times
parent
df92d0ec0a
commit
cc178b1ebd
|
@ -53,7 +53,17 @@ func (c *RoomController) AddICECandidate(ctx *gin.Context) {
|
||||||
c.helper.ResponseUnprocessableEntity(ctx)
|
c.helper.ResponseUnprocessableEntity(ctx)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
tryCounter := 0
|
||||||
|
start:
|
||||||
err := c.repo.AddPeerIceCandidate(reqModel.RoomId, reqModel.ID, reqModel.ICECandidate)
|
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) {
|
if c.helper.HandleIfErr(ctx, err, nil) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue