allocate node for autocreated room in agent dispatch (#3344)

This commit is contained in:
Paul Wells
2025-01-17 00:54:30 -08:00
committed by GitHub
parent eca6ffa9e2
commit 759e5f79e0

View File

@@ -51,7 +51,11 @@ func (ag *AgentDispatchService) CreateDispatch(ctx context.Context, req *livekit
}
if ag.roomAllocator.AutoCreateEnabled(ctx) {
// ensure at least one node is available to handle the request
err := ag.roomAllocator.SelectRoomNode(ctx, livekit.RoomName(req.Room), "")
if err != nil {
return nil, err
}
_, err = ag.router.CreateRoom(ctx, &livekit.CreateRoomRequest{Name: req.Room})
if err != nil {
return nil, err