Skip to content

Commit

Permalink
Don't cache false responses.
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell Jones committed Dec 15, 2014
1 parent 788d773 commit e5da460
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions flanker/addresslib/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,17 @@ def mail_exchanger_lookup(domain, metrics=False):
mx_hosts = lookup_domain(domain)
mtimes['dns_lookup'] += time.time() - bstart
if mx_hosts is None:
mx_cache[domain] = False
#commenting out falses in the cache, be sure to monitor backend load. - Jason
#mx_cache[domain] = False
return None, mtimes

# test connecting to the mx exchanger
bstart = time.time()
mail_exchanger = connect_to_mail_exchanger(mx_hosts)
mtimes['mx_conn'] = time.time() - bstart
if mail_exchanger is None:
mx_cache[domain] = False
#commenting out falses in the cache, be sure to monitor backend load. - Jason
#mx_cache[domain] = False
return None, mtimes

# valid mx records, connected to mail exchanger, return True
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


setup(name='flanker',
version='0.3.24',
version='0.3.25',
description='Mailgun Parsing Tools',
long_description=open('README.rst').read(),
classifiers=[],
Expand Down

0 comments on commit e5da460

Please sign in to comment.