Do not generate a stream key for URL pull ingress (#1993)
This commit is contained in:
@@ -514,7 +514,7 @@ func (s *RedisStore) storeIngress(_ context.Context, info *livekit.IngressInfo)
|
||||
if info.IngressId == "" {
|
||||
return errors.New("Missing IngressId")
|
||||
}
|
||||
if info.StreamKey == "" {
|
||||
if info.StreamKey == "" && info.InputType != livekit.IngressInput_URL_INPUT {
|
||||
return errors.New("Missing StreamKey")
|
||||
}
|
||||
|
||||
@@ -543,7 +543,9 @@ func (s *RedisStore) storeIngress(_ context.Context, info *livekit.IngressInfo)
|
||||
|
||||
results, err := tx.TxPipelined(s.ctx, func(p redis.Pipeliner) error {
|
||||
p.HSet(s.ctx, IngressKey, info.IngressId, data)
|
||||
p.HSet(s.ctx, StreamKeyKey, info.StreamKey, info.IngressId)
|
||||
if info.StreamKey != "" {
|
||||
p.HSet(s.ctx, StreamKeyKey, info.StreamKey, info.IngressId)
|
||||
}
|
||||
|
||||
if oldRoom != info.RoomName {
|
||||
if oldRoom != "" {
|
||||
@@ -799,7 +801,9 @@ func (s *RedisStore) UpdateIngressState(ctx context.Context, ingressId string, s
|
||||
func (s *RedisStore) DeleteIngress(_ context.Context, info *livekit.IngressInfo) error {
|
||||
tx := s.rc.TxPipeline()
|
||||
tx.SRem(s.ctx, RoomIngressPrefix+info.RoomName, info.IngressId)
|
||||
tx.HDel(s.ctx, StreamKeyKey, info.IngressId)
|
||||
if info.StreamKey != "" {
|
||||
tx.HDel(s.ctx, StreamKeyKey, info.StreamKey)
|
||||
}
|
||||
tx.HDel(s.ctx, IngressKey, info.IngressId)
|
||||
tx.Del(s.ctx, IngressStatePrefix+info.IngressId)
|
||||
if _, err := tx.Exec(s.ctx); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user