Updated egress rpc (#1252)

* updated egress rpc

* check if egress exists on stop

* fix static check

* remove old migration code

* rename

* regenerate, update test

* latest staticcheck

* update to psrpc 0.1.0

* fix tests

* dual write rpcs on running egress

* remove unused field

* fix race, change service for egress impl

* return nil if bus is nil

* id -> ids

* add affinityFunc to StartEgress
This commit is contained in:
David Colburn
2022-12-22 21:03:27 -08:00
committed by GitHub
parent 05132799a5
commit 6719a3c714
15 changed files with 1031 additions and 187 deletions
+11
View File
@@ -13,12 +13,14 @@ import (
"github.com/pkg/errors"
"gopkg.in/yaml.v3"
"github.com/livekit/livekit-server/pkg/service/rpc"
"github.com/livekit/protocol/auth"
"github.com/livekit/protocol/egress"
"github.com/livekit/protocol/ingress"
"github.com/livekit/protocol/livekit"
redisLiveKit "github.com/livekit/protocol/redis"
"github.com/livekit/protocol/webhook"
"github.com/livekit/psrpc"
"github.com/livekit/livekit-server/pkg/clientconfiguration"
"github.com/livekit/livekit-server/pkg/config"
@@ -42,6 +44,8 @@ func InitializeServer(conf *config.Config, currentNode routing.LocalNode) (*Live
wire.Bind(new(livekit.RoomService), new(*RoomService)),
telemetry.NewAnalyticsService,
telemetry.NewTelemetryService,
getMessageBus,
rpc.NewEgressClient,
egress.NewRedisRPCClient,
getEgressStore,
NewEgressLauncher,
@@ -130,6 +134,13 @@ func createStore(rc redis.UniversalClient) ObjectStore {
return NewLocalStore()
}
func getMessageBus(rc redis.UniversalClient) psrpc.MessageBus {
if rc == nil {
return nil
}
return psrpc.NewRedisMessageBus(rc)
}
func getEgressStore(s ObjectStore) EgressStore {
switch store := s.(type) {
case *RedisStore: