def get(self, status):
""""
Gets the count of records for a given status.
This function will fall back to query the database if no memcached
result is returned.
Args:
status - str - The status to query for
"""
count = memcache.get(key=status, namespace=self._namespace)
if count != None:
return count
# Update the memcache store if we hit the database
Stats.update(self._domain)
return EmailReport.query(EmailReport.reported_domain == self._domain,
EmailReport.status == status).count()
评论列表
文章目录