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

Caching does not work with default args #19

Open
Kemaweyan opened this issue Dec 5, 2023 · 0 comments
Open

Caching does not work with default args #19

Kemaweyan opened this issue Dec 5, 2023 · 0 comments

Comments

@Kemaweyan
Copy link

This code does not work

import requests

dns_cache.override_system_resolver()

for i in range(10):
     requests.get('http://www.coala.io/')

It does not speed up requests but makes them even slowly. Looking into the library code I found that the get method is being called for the dns_cache.hosts.HostsCache object, but the put method calls - for dns_cache.expiration.MinExpirationCache. Of course, it could cache nothing because the self.data dicts are different and the get method could not find items stored in the put method of another object.

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

1 participant