oidstore.py 文件源码

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

项目:mist.api 作者: mistio 项目源码 文件源码
def cleanupNonces(self):
        """Remove expired nonces from the store.
        Discards any nonce from storage that is old enough that its
        timestamp would not pass L{useNonce}.
        This method is not called in the normal operation of the
        library.  It provides a way for store admins to keep
        their storage from filling up with expired data.
        @return: the number of nonces expired.
        @returntype: int
        """
        try:
            mist_nonces = MistNonce.objects()
        except me.DoesNotExist:
            mist_nonces = []

        counter = 0
        for nonce in mist_nonces:
            if nonce.is_old():
                nonce.delete()
                counter += 1

        return counter
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号