Temporarily break imgur.com domain listings for the greater good.

Turns out, this is the entire cause of current permacache lock
contention causing vote processing slowdowns.
This commit is contained in:
Neil Williams
2012-12-01 21:29:36 -08:00
parent f8c264a7de
commit db7e5e9ac6
2 changed files with 11 additions and 3 deletions

View File

@@ -916,9 +916,11 @@ def new_vote(vote, foreground=False, timer=None):
get_links(sr, 'controversial', 'all'),
])
for domain in utils.UrlParser(item.url).domain_permutations():
for sort in ("hot", "top", "controversial"):
results.append(get_domain_links(domain, sort, "all"))
parsed = utils.UrlParser(item.url)
if parsed.hostname and not parsed.hostname.endswith('imgur.com'):
for domain in parsed.domain_permutations():
for sort in ("hot", "top", "controversial"):
results.append(get_domain_links(domain, sort, "all"))
add_queries(results, insert_items = item, foreground=foreground)

View File

@@ -178,6 +178,12 @@ class Reddit(Templated):
elif c.firsttime and c.site.firsttext:
infotext = c.site.firsttext
if isinstance(c.site, DomainSR) and c.site.domain.endswith("imgur.com"):
self.infobar = InfoBar(
message=_("imgur.com domain listings (including this one) are "
"currently disabled to speed up vote processing.")
)
if infotext:
self.infobar = InfoBar(message = infotext)