def get_last(cls, domain, days=30):
"""
Gets the entries for the specified number of days. This will
first query memcached, using datastore as a fallback.
"""
if days > cls._memcache_date_offset:
return cls._get_from_datastore(domain, days)
cached = memcache.get(
key=cls._memcache_key, namespace='{}|'.format(domain))
if cached:
records = json.loads(cached)
return records
return cls._update_memcached(domain)
评论列表
文章目录