RoomRecorder (#70)

This commit is contained in:
David Colburn
2021-07-27 00:39:48 -05:00
committed by GitHub
parent f8782fae3f
commit b00d5a02cb
10 changed files with 203 additions and 68 deletions
+3 -18
View File
@@ -145,11 +145,7 @@ func createSingleNodeServer() *service.LivekitServer {
}
currentNode.Id = utils.NewGuid(nodeId1)
// local routing and store
router := routing.NewLocalRouter(currentNode)
roomStore := service.NewLocalRoomStore()
_ = roomStore.DeleteRoom(testRoom)
s, err := service.InitializeServer(conf, &StaticKeyProvider{}, roomStore, router, currentNode, &routing.RandomSelector{})
s, err := service.InitializeServer(conf, &StaticKeyProvider{}, currentNode, &routing.RandomSelector{})
if err != nil {
panic(fmt.Sprintf("could not create server: %v", err))
}
@@ -176,19 +172,8 @@ func createMultiNodeServer(nodeId string, port uint32) *service.LivekitServer {
}
currentNode.Id = nodeId
// local routing and store
rc := redisClient()
if err = rc.Ping(context.Background()).Err(); err != nil {
panic(err)
}
if err = rc.Del(context.Background(), routing.NodesKey).Err(); err != nil {
panic(err)
}
router := routing.NewRedisRouter(currentNode, rc)
roomStore := service.NewRedisRoomStore(rc)
_ = roomStore.DeleteRoom(testRoom)
s, err := service.InitializeServer(conf, &StaticKeyProvider{}, roomStore, router, currentNode, &routing.RandomSelector{})
// redis routing and store
s, err := service.InitializeServer(conf, &StaticKeyProvider{}, currentNode, &routing.RandomSelector{})
if err != nil {
panic(fmt.Sprintf("could not create server: %v", err))
}
+2 -5
View File
@@ -28,10 +28,7 @@ func testTurnServer(t *testing.T) {
currentNode.Id = utils.NewGuid(nodeId1)
// local routing and store
router := routing.NewLocalRouter(currentNode)
roomStore := service.NewLocalRoomStore()
roomStore.DeleteRoom(testRoom)
s, err := service.InitializeServer(conf, &StaticKeyProvider{}, roomStore, router, currentNode, &routing.RandomSelector{})
s, err := service.InitializeServer(conf, &StaticKeyProvider{}, currentNode, &routing.RandomSelector{})
require.NoError(t, err)
go s.Start()
waitForServerToStart(s)
@@ -45,7 +42,7 @@ func testTurnServer(t *testing.T) {
Name: "testroom",
TurnPassword: utils.RandomSecret(),
}
require.NoError(t, roomStore.CreateRoom(rm))
// require.NoError(t, roomStore.CreateRoom(rm))
turnConf := &turn.ClientConfig{
STUNServerAddr: fmt.Sprintf("localhost:%d", conf.TURN.TLSPort),