writing.py 文件源码

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

项目:nstock 作者: ybenitezf 项目源码 文件源码
def commit(self, restart=True):
        if self.period:
            self.timer.cancel()

        with self.lock:
            ramreader = self._get_ram_reader()
            self._make_ram_index()

        if self.bufferedcount:
            self.writer.add_reader(ramreader)
        self.writer.commit(**self.commitargs)
        self.bufferedcount = 0

        if restart:
            self.writer = self.index.writer(**self.writerargs)
            if self.period:
                self.timer = threading.Timer(self.period, self.commit)
                self.timer.start()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号