CreateRoom API to actually create the room on an RTC node (#1155)
Previously, CreateRoom only created the room in storage, but did not hydrate it on an RTC node. This has caused strange behaviors such as emptyTimeout not working correctly (#1109). Also reduced room reap worker to consistently reap rooms. Fixes #241
This commit is contained in:
@@ -61,6 +61,17 @@ func (s *RoomService) CreateRoom(ctx context.Context, req *livekit.CreateRoomReq
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// actually start the room on an RTC node, to ensure metadata & empty timeout functionality
|
||||
_, sink, source, err := s.router.StartParticipantSignal(ctx,
|
||||
livekit.RoomName(req.Name),
|
||||
routing.ParticipantInit{},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sink.Close()
|
||||
source.Close()
|
||||
|
||||
if req.Egress != nil && req.Egress.Room != nil {
|
||||
egress := &livekit.StartEgressRequest{
|
||||
Request: &livekit.StartEgressRequest_RoomComposite{
|
||||
|
||||
Reference in New Issue
Block a user