def _update_memcached(cls, domain, time=3600 * 24, records=None):
"""
Updates memcached with the latest data from the datastore
and returns that data. By default stores entries to expire after
24 hours.
"""
namespace = "{}|".format(domain)
if not records:
records = cls._get_from_datastore(domain,
cls._memcache_date_offset)
memcache.set(
key=cls._memcache_key,
namespace=namespace,
value=json.dumps(records),
time=time)
return records
评论列表
文章目录