def autodetect():
"""Detects an appropriate cache module and returns it.
Returns:
googleapiclient.discovery_cache.base.Cache, a cache object which
is auto detected, or None if no cache object is available.
"""
try:
from google.appengine.api import memcache
from . import appengine_memcache
return appengine_memcache.cache
except Exception:
try:
from . import file_cache
return file_cache.cache
except Exception as e:
logging.warning(e, exc_info=True)
return None
评论列表
文章目录