ratelimitcache.py 文件源码

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

项目:ecs 作者: ecs-org 项目源码 文件源码
def cache_incr(self, key):
        # memcache is only backend that can increment atomically
        try:
            # add first, to ensure the key exists
            cache.add(key, 0, timeout=self.expire_after())
            cache.incr(key)
        except AttributeError:
            cache.set(key, cache.get(key, 0) + 1, self.expire_after())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号