Confirm room creation prior to returning from CreateRoom (#1157)

This commit is contained in:
David Zhao
2022-11-09 23:47:41 -08:00
committed by GitHub
parent e5d21cb1d9
commit e2d775588f

View File

@@ -72,6 +72,19 @@ func (s *RoomService) CreateRoom(ctx context.Context, req *livekit.CreateRoomReq
sink.Close()
source.Close()
// ensure it's created correctly
err = confirmExecution(func() error {
_, _, err := s.roomStore.LoadRoom(ctx, livekit.RoomName(req.Name), false)
if err != nil {
return ErrOperationFailed
} else {
return nil
}
})
if err != nil {
return nil, err
}
if req.Egress != nil && req.Egress.Room != nil {
egress := &livekit.StartEgressRequest{
Request: &livekit.StartEgressRequest_RoomComposite{