etcdutils.py 文件源码

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

项目:networking-vpp 作者: openstack 项目源码 文件源码
def watch_forever(self):
        """Watch a keyspace forevermore

        This may not exit - if there are errors they're logged (and in case
        they are persistent we pause).
        """

        while True:
            try:
                self.do_tick()
                if self.etcd_elector:
                    self.etcd_elector.wait_until_elected()
                self.do_watch()
            except Exception:
                LOG.exception('%s: etcd threw exception',
                              self.name)
                # In case of a dead etcd causing continuous
                # exceptions, the pause here avoids eating all the
                # CPU
                time.sleep(self.DANGER_PAUSE)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号