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

[REQUEST] Option to not cache errors #258

Open
Tracked by #297
dyst5422 opened this issue Jan 23, 2021 · 0 comments
Open
Tracked by #297

[REQUEST] Option to not cache errors #258

dyst5422 opened this issue Jan 23, 2021 · 0 comments

Comments

@dyst5422
Copy link

What problem are you trying to solve?

We have cases where we are using a dataloader on the server that utilizes server credentials to cache data that is used to resolve user requests (but not directly accessible to users). We refresh this cache everytime our server credentials are renewed (8 hrs). However, if we end up receiving a network error in those 8 hours, we cache that error as the response for a load.

Describe the solution you'd like

An option to not cache errors returned in the batch load return array. Or a comparison function that can evaluate whether to cache or not. (eg instanceof checks for certain error types)

Describe alternatives you've considered

Add additional code at all .load sites to clear the cache of these error values. This is onerous and prone to error
Monkeypatching the dataloader load function to clear the cache when an error is returned.

Additional context

This seems like it would be handy, but I also understand if it is an overspecific feature

@saihaj saihaj mentioned this issue Mar 11, 2022
26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant