def update(cls, domain, time=0):
"""
Updates the memcached stats for a given domain
This is used when a report is updated so that memcached
has the current stats.
Args:
domain - str - The domain to use for the namespace
time - int - The timeout for stored keys (default: 5 seconds)
"""
namespace = "{}|".format(domain)
records = cls._get_from_datastore(domain, cls._memcache_result_count)
memcache.set(
key=cls._memcache_key,
namespace=namespace,
value=json.dumps(records),
time=time)
评论列表
文章目录