error pages shouldn't trip the 503 rate limiter

This commit is contained in:
KeyserSosa
2008-10-22 16:23:11 -07:00
parent f16c58bc42
commit 5d32a27917
2 changed files with 3 additions and 1 deletions

View File

@@ -85,6 +85,7 @@ class ErrorController(RedditController):
allowed_render_styles = ('html', 'xml', 'js', 'embed', '')
def __before__(self):
try:
c.error_page = True
RedditController.__before__(self)
except:
handle_awful_failure("Error occurred in ErrorController.__before__")

View File

@@ -433,7 +433,8 @@ class RedditController(BaseController):
g.cache.caches = (LocalCache(),) + g.cache.caches[1:]
#check if user-agent needs a dose of rate-limiting
ratelimit_agents()
if not c.error_page:
ratelimit_agents()
# the domain has to be set before Cookies get initialized
set_subreddit()