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)
评论列表
文章目录