eko/gocache

ChainCache.Get failing with BigCache store v4.2.0 (GetWithTTL not implemented error)

butaca opened this issue · 0 comments

butaca commented

When using BigCache in a chain, ChainCache.Get fails because it uses GetWithTTL and that function in BigCache is not implemented and returns an error. The change was merged recently: d94f5d2 in big cache store v4.2.0 store/bigcache/v4.1.2...store/bigcache/v4.2.0

Steps for Reproduction

  1. Set up a chain cache with a BigCache store
bigcacheClient, _ := bigcache.New(ctx, bigcache.DefaultConfig(5 * time.Minute))
bigcacheStore := bigcache_store.NewBigcache(bigcacheClient)
bigCacheCache := cache.New[[]byte](bigcacheStore)
chain := cache.NewChain[[]byte](bigCacheCache)
  1. Get a value
_, err := chain.Get(ctx, "key")
fmt.Printf("%v\n", err)
  1. See how it returns an error

Expected behavior:
The function does not return an error

Actual behavior:
The function returns an error

Platforms:

macOS and dockerized Linux from scratch

Versions:

gocache v4.1.4
go 1.21
BigCache store v4.2.0
BigCache v3.1.0