diff --git a/splitio/proxy/caching/workers.go b/splitio/proxy/caching/workers.go index 3296dc0f..eab8da66 100644 --- a/splitio/proxy/caching/workers.go +++ b/splitio/proxy/caching/workers.go @@ -1,6 +1,8 @@ package caching import ( + "fmt" + "github.com/splitio/go-split-commons/v6/dtos" "github.com/splitio/go-split-commons/v6/flagsets" "github.com/splitio/go-split-commons/v6/healthcheck/application" @@ -206,7 +208,8 @@ func (c *CacheAwareLargeSegmentSynchronizer) SynchronizeLargeSegments() (map[str } func (c *CacheAwareLargeSegmentSynchronizer) shouldEvictBySurrogate(name string, previousCN int64, currentCN int64) { - if currentCN > previousCN || (previousCN > 0 && currentCN == -1) { + if currentCN > previousCN || currentCN == -1 { + fmt.Println("aca") c.cacheFlusher.EvictBySurrogate(MakeSurrogateForLargeSegmentChanges(name)) } } diff --git a/splitio/proxy/caching/workers_test.go b/splitio/proxy/caching/workers_test.go index eb3f9bf0..8f50c625 100644 --- a/splitio/proxy/caching/workers_test.go +++ b/splitio/proxy/caching/workers_test.go @@ -316,8 +316,8 @@ func TestSynchronizeLargeSegments(t *testing.T) { var cn1 int64 = 100 var cn2 int64 = 200 var largeSegmentStorage mocks.LargeSegmentStorageMock - largeSegmentStorage.On("ChangeNumber", "ls1").Return(cn1).Once() - largeSegmentStorage.On("ChangeNumber", "ls2").Return(cn2).Once() + largeSegmentStorage.On("ChangeNumber", "ls1").Return(cn1 - 50).Once() + largeSegmentStorage.On("ChangeNumber", "ls2").Return(cn2 - 50).Once() var lsUpdater mocks.LargeSegmentUpdaterMock result := map[string]*int64{