-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add possibility to cache dns lookups #58
Conversation
8638431
to
140f2ff
Compare
Add optional argument dns_resolver to validate_email. If provided it will be used instead of the default resolver. The provided resolver can have a configured cache and custom timeout. Example usage: dns_resolver = dns.resolver.Resolver() dns_resolver.cache = dns.resolver.Cache() dns_resolver.timeout = 10 valid = validate_email("test@gmail.com", dns_resolver=dns_resolver)
140f2ff
to
c4f0e89
Compare
Excellent. This is basically what I was thinking. I made some tweaks. If you think it's OK, I'll merge. Happy to keep discussing otherwise. |
c9e5547
to
7527a97
Compare
Codecov Report
@@ Coverage Diff @@
## primary #58 +/- ##
===========================================
+ Coverage 83.77% 84.12% +0.34%
===========================================
Files 1 1
Lines 228 233 +5
===========================================
+ Hits 191 196 +5
Misses 37 37
Continue to review full report at Codecov.
|
Nice! Good with the helper function. Looks good. I fixed linting so lint checks pass. |
Thanks! |
The DNS resolve cache is great. Any ETA for when this will get pushed to pypi? |
Add optional argument dns_resolver to validate_email. If provided it will be used instead of the default resolver. The provided resolver can have a configured cache and custom timeout. Closes #55
Example usage: