Confirm room creation prior to returning from CreateRoom (#1157)
This commit is contained in:
@@ -72,6 +72,19 @@ func (s *RoomService) CreateRoom(ctx context.Context, req *livekit.CreateRoomReq
|
|||||||
sink.Close()
|
sink.Close()
|
||||||
source.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 {
|
if req.Egress != nil && req.Egress.Room != nil {
|
||||||
egress := &livekit.StartEgressRequest{
|
egress := &livekit.StartEgressRequest{
|
||||||
Request: &livekit.StartEgressRequest_RoomComposite{
|
Request: &livekit.StartEgressRequest_RoomComposite{
|
||||||
|
|||||||
Reference in New Issue
Block a user