email.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:isthislegit 作者: duo-labs 项目源码 文件源码
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('stats', domain)

        for status in VALID_STATUSES:
            count = EmailReport.query(EmailReport.reported_domain == domain,
                                      EmailReport.status == status).count()
            memcache.set(
                key=status, namespace=namespace, value=count, time=time)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号