forked from ScoDoc/ScoDoc
Handle unexpected errors from pylibmc
This commit is contained in:
parent
84c72fcb50
commit
4aa073beb3
@ -55,7 +55,9 @@
|
||||
#
|
||||
|
||||
import time
|
||||
import traceback
|
||||
|
||||
import pylibmc
|
||||
from flask import g
|
||||
|
||||
from app.scodoc import notesdb as ndb
|
||||
@ -80,7 +82,12 @@ class ScoDocCache:
|
||||
@classmethod
|
||||
def get(cls, oid):
|
||||
"""Returns cached evaluation, or None"""
|
||||
return CACHE.get(cls._get_key(oid))
|
||||
try:
|
||||
return CACHE.get(cls._get_key(oid))
|
||||
except pylibmc.Error:
|
||||
log("Warning: memcached error")
|
||||
log(traceback.format_exc())
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def set(cls, oid, value):
|
||||
|
Loading…
Reference in New Issue
Block a user