mirror of
https://github.com/livekit/livekit.git
synced 2026-04-01 00:05:40 +00:00
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()
|
||||
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{
|
||||
|
||||
Reference in New Issue
Block a user