This commit is contained in:
Benjamin Pracht committed 2022-08-02 19:21:51 -07:00
1 parent 0f074aeb98
commit 0898912d78
1 file changed
+13
+13
View File
@@ -32,6 +32,7 @@ const (
// IngressKey is a hash of ingressID => ingress info
IngressKey = "ingress"
IngressStateKey = "ingress_state"
StreamKeyKey = "stream_key"
RoomIngressPrefix = "room_ingress:"
@@ -446,6 +447,9 @@ func (s *RedisStore) StoreIngress(_ context.Context, info *livekit.IngressInfo)
return errors.New("Missing StreamKey")
}
// State is stored independently
info.State = nil
data, err := proto.Marshal(info)
if err != nil {
return err
@@ -512,6 +516,15 @@ func (s *RedisStore) StoreIngress(_ context.Context, info *livekit.IngressInfo)
return nil
}
func (s *RedisStore) StoreIngress(_ context.Context, ingressId string, state *livekit.IngressState) error {
if info.IngressId == "" {
return errors.New("invalid IngressId")
}
// Should we make sure the ingress exists?
}
func (s *RedisStore) loadIngress(c redis.Cmdable, ingressId string) (*livekit.IngressInfo, error) {
data, err := c.HGet(s.ctx, IngressKey, ingressId).Result()
switch err {