pagecache: Degrade gracefully if pagecache.get() fails.

This commit is contained in:
Neil Williams
2013-11-25 11:55:15 -08:00
parent 311d876896
commit ac25e39dda

View File

@@ -787,7 +787,13 @@ class MinimalController(BaseController):
c.can_use_pagecache = self.can_use_pagecache()
if request.method.upper() == 'GET' and c.can_use_pagecache:
r = g.pagecache.get(self.request_key())
request_key = self.request_key()
try:
r = g.pagecache.get(request_key)
except MemcachedError as e:
g.log.warning("pagecache error: %s", e)
return
if r:
r, c.cookies = r
response.headers = r.headers