cache.py 文件源码

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

项目:inmanta 作者: inmanta 项目源码 文件源码
def _cache(self, item: CacheItem):
        scope = item.scope

        if item.key in self.cache:
            raise Exception("Added same item twice")

        self.cache[item.key] = item

        if scope.version != 0:
            try:
                self.keysforVersion[scope.version].add(item.key)
            except KeyError:
                raise Exception("Added data to version that is not open")

        bisect.insort_right(self.timerqueue, item)
        if item.time < self.nextAction:
            self.nextAction = item.time
        self._advance_time()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号