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

Check that caching is enabled before using it #215

Merged
merged 1 commit into from Nov 13, 2019
Merged

Conversation

leebyron
Copy link
Contributor

The existing behavior for a DataLoader with caching disabled is to still create a cache Map, which allows the prime() and clear() methods to continue to interact with that cache even though nothing will read from it. A classic "write-only cache"!

This fixes this behavior by not creating a cache Map for DataLoaders with caching disabled and checks for this case before interacting with the cache.

Fixes #161

@leebyron leebyron merged commit 7521777 into master Nov 13, 2019
@leebyron leebyron deleted the check-before-cache branch November 13, 2019 19:31
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

Successfully merging this pull request may close these issues.

None yet

1 participant