Skip to content
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

NoCache option doesn't seems to work in v6.0.0 #96

Open
zdraganov opened this issue Nov 1, 2022 · 3 comments
Open

NoCache option doesn't seems to work in v6.0.0 #96

zdraganov opened this issue Nov 1, 2022 · 3 comments

Comments

@zdraganov
Copy link

zdraganov commented Nov 1, 2022

Hello all,

I receive a panic when using the loader with the NoCache option. The same code works fine with InMemoryCache passed or by default.

Anyone managed to make the NoCache working in v6.0.0

ctx = context.WithValue(ctx, k, dataloader.NewBatchedLoader(helloBatchFunction, dataloader.WithCache(&dataloader.NoCache{})))

And the time I invoke the Load(ctx, key) function, I receive some internal panic in the dataloader package.

panic({0x18b7660, 0x277de20})
/usr/local/go/src/runtime/panic.go:844 +0x264
github.com/myorg/myrepo/internal/loader.(*pairsTournamentLoader).loadBatch(0x40006b3380, {0x1c5e9c8, 0x4000daed20}, {0x4000dac9c0, 0x3, 0x4})
/app/internal/loader/hello_loader.go:73 +0x600
github.com/graph-gophers/dataloader.(*batcher).batch.func1(0x4000de8df0, 0x4000daeea0, {0x1c5e9c8, 0x4000daed20}, {0x4000dac9c0, 0x3, 0x4}, 0x4000f29e80)
/go/pkg/mod/github.com/graph-gophers/dataloader@v5.0.0+incompatible/dataloader.go:432 +0xb4
github.com/graph-gophers/dataloader.(*batcher).batch(0x4000daeea0, {0x1c5e9c8, 0x4000daed20})
/go/pkg/mod/github.com/graph-gophers/dataloader@v5.0.0+incompatible/dataloader.go:433 +0x320
created by github.com/graph-gophers/dataloader.(*Loader).Load
/go/pkg/mod/github.com/graph-gophers/dataloader@v5.0.0+incompatible/dataloader.go:241 +0x568
@zdraganov zdraganov changed the title Noop cache doesn't seems to work in v6.0.0 NoCache doesn't seems to work in v6.0.0 Nov 1, 2022
@zdraganov zdraganov changed the title NoCache doesn't seems to work in v6.0.0 NoCache option doesn't seems to work in v6.0.0 Nov 1, 2022
@mgreer
Copy link

mgreer commented Mar 22, 2023

Having same issue

@eaglemoor
Copy link

Please, don't use context for storage DataLoader. It's not good way.

Can u write some example for check your problem ? Because in example https://github.com/graph-gophers/dataloader/blob/v6.0.0/example/no_cache/no_cache_test.go all work fine.

@zenyui
Copy link

zenyui commented Jul 20, 2023

Same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants