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 time
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
import pylibmc
|
||||||
from flask import g
|
from flask import g
|
||||||
|
|
||||||
from app.scodoc import notesdb as ndb
|
from app.scodoc import notesdb as ndb
|
||||||
@ -80,7 +82,12 @@ class ScoDocCache:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get(cls, oid):
|
def get(cls, oid):
|
||||||
"""Returns cached evaluation, or None"""
|
"""Returns cached evaluation, or None"""
|
||||||
|
try:
|
||||||
return CACHE.get(cls._get_key(oid))
|
return CACHE.get(cls._get_key(oid))
|
||||||
|
except pylibmc.Error:
|
||||||
|
log("Warning: memcached error")
|
||||||
|
log(traceback.format_exc())
|
||||||
|
return None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def set(cls, oid, value):
|
def set(cls, oid, value):
|
||||||
|
Loading…
Reference in New Issue
Block a user