-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ristretto store doesn't work as expected #207
Comments
I have also encountered this problem. May I ask how to solve it? |
func main() {
ristrettoCache, err := ristretto.NewCache(&ristretto.Config{
NumCounters: 1000,
MaxCost: 100,
BufferItems: 64,
})
if err != nil {
panic(err)
}
ristrettoStore := ristretto_store.NewRistretto(ristrettoCache)
ch := cache.New[string](ristrettoStore)
err = ch.Set(context.Background(), "test", "value")
if err != nil {
panic(fmt.Sprintf("err in set:%+v\n", err))
}
ristrettoCache.Wait()
value, err := ch.Get(context.Background(), "test")
if err != nil {
panic(fmt.Sprintf("err in get:%+v\n", err))
}
fmt.Println("The value is ", value)
}
|
Closing this issue as there is no issue with the Gocache library. Maybe we could add an option to the Gocache's store configuration to automatically call Please feel free to open a pull request if you want to or reopen this issue if you still have any issue! Thank you |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simply setting a value and getting it fails when using ristretto store.
Steps for Reproduction
Expected behavior:
Expected the value to be printed
Actual behavior:
Getting an error "value not found in store"
Platforms:
Windows WSL
Extras:
I think the error is happening because ristretto expects to wait after a key is set, but the ristretto store implementation doesn't do that.
Refer this example where the
Wait()
function is used afterSet()
for the value to pass through buffers.https://github.com/dgraph-io/ristretto#Example
The text was updated successfully, but these errors were encountered: