Import ErrIngressOutOfDate from protocol (#987)
This commit is contained in:
@@ -16,5 +16,4 @@ var (
|
||||
ErrRoomUnlockFailed = errors.New("could not unlock room, lock token does not match")
|
||||
ErrTrackNotFound = errors.New("track is not found")
|
||||
ErrWebHookMissingAPIKey = errors.New("api_key is required to use webhooks")
|
||||
ErrIngressOutOfDate = errors.New("trying to ovewrite an ingress with an older version")
|
||||
)
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/livekit/livekit-server/version"
|
||||
"github.com/livekit/protocol/ingress"
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/logger"
|
||||
"github.com/livekit/protocol/utils"
|
||||
@@ -474,7 +475,7 @@ func (s *RedisStore) StoreIngress(_ context.Context, info *livekit.IngressInfo)
|
||||
results, err := tx.TxPipelined(s.ctx, func(p redis.Pipeliner) error {
|
||||
if info.State.StartedAt < oldStartedAt {
|
||||
// Do not overwrite the info and state of a more recent session
|
||||
return ErrIngressOutOfDate
|
||||
return ingress.ErrIngressOutOfDate
|
||||
}
|
||||
|
||||
p.HSet(s.ctx, IngressKey, info.IngressId, data)
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"go.uber.org/atomic"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/livekit/protocol/ingress"
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/utils"
|
||||
|
||||
@@ -256,7 +257,7 @@ func TestIngressStore(t *testing.T) {
|
||||
info.RoomName = "room2"
|
||||
info.State.StartedAt = 1
|
||||
err = rs.UpdateIngress(ctx, info)
|
||||
require.Equal(t, service.ErrIngressOutOfDate, err)
|
||||
require.Equal(t, ingress.ErrIngressOutOfDate, err)
|
||||
|
||||
info.RoomName = "room2"
|
||||
info.State.StartedAt = 3
|
||||
|
||||
Reference in New Issue
Block a user