Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzmauro committed Nov 25, 2024
1 parent a7e24cf commit 01b0079
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ require (
github.com/gin-gonic/gin v1.10.0
github.com/google/uuid v1.3.0
github.com/splitio/gincache v1.0.1
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241122192419-cc8d0413fa8e
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241125153044-959311072c68
github.com/splitio/go-toolkit/v5 v5.4.0
github.com/stretchr/testify v1.9.0
go.etcd.io/bbolt v1.3.6
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
)

replace github.com/splitio/go-split-commons/v6 => /Users/maurosanz/go/src/github/splitio/go-split-commons

require (
github.com/bits-and-blooms/bitset v1.3.1 // indirect
github.com/bits-and-blooms/bloom/v3 v3.3.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUA
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/splitio/gincache v1.0.1 h1:dLYdANY/BqH4KcUMCe/LluLyV5WtuE/LEdQWRE06IXU=
github.com/splitio/gincache v1.0.1/go.mod h1:CcgJDSM9Af75kyBH0724v55URVwMBuSj5x1eCWIOECY=
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241122192419-cc8d0413fa8e h1:0PMjUqkHtruM6arvxNbC3Yu6goqdkL/FuYeoWNmQ3K4=
github.com/splitio/go-split-commons/v6 v6.0.2-0.20241122192419-cc8d0413fa8e/go.mod h1:D/XIY/9Hmfk9ivWsRsJVp439kEdmHbzUi3PKzQQDOXY=
github.com/splitio/go-toolkit/v5 v5.4.0 h1:g5WFpRhQomnXCmvfsNOWV4s5AuUrWIZ+amM68G8NBKM=
github.com/splitio/go-toolkit/v5 v5.4.0/go.mod h1:xYhUvV1gga9/1029Wbp5pjnR6Cy8nvBpjw99wAbsMko=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
3 changes: 3 additions & 0 deletions splitio/proxy/caching/mocks/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ func (s *LargeSegmentStorageMock) IsInLargeSegment(name string, key string) (boo
args := s.Called(name, key)
return args.Get(0).(bool), args.Error(1)
}
func (s *LargeSegmentStorageMock) TotalKeys(name string) int {
return s.Called(name).Get(0).(int)
}

// ---

Expand Down
2 changes: 1 addition & 1 deletion splitio/proxy/caching/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (c *CacheAwareLargeSegmentSynchronizer) SynchronizeLargeSegments() (map[str
}

func (c *CacheAwareLargeSegmentSynchronizer) shouldEvictBySurrogate(name string, previousCN int64, currentCN int64) {
if currentCN > previousCN || currentCN == -1 {
if currentCN > previousCN || (previousCN != -1 && currentCN == -1) {
c.cacheFlusher.EvictBySurrogate(MakeSurrogateForLargeSegmentChanges(name))
}
}
Expand Down

0 comments on commit 01b0079

Please sign in to comment.