Don't bail out if write fails, keep retrying
This commit is contained in:
parent
6ead21a308
commit
4d6842f942
|
@ -227,8 +227,15 @@ class ZookeeperLogger(Thread):
|
||||||
date = ''
|
date = ''
|
||||||
# Add the message to the deque
|
# Add the message to the deque
|
||||||
logs.append(f'{date}{message}')
|
logs.append(f'{date}{message}')
|
||||||
|
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
# Write the updated messages into Zookeeper
|
# Write the updated messages into Zookeeper
|
||||||
self.zkhandler.write([(('logs.messages', self.node), '\n'.join(logs))])
|
self.zkhandler.write([(('logs.messages', self.node), '\n'.join(logs))])
|
||||||
|
break
|
||||||
|
except Exception:
|
||||||
|
sleep(0.1)
|
||||||
|
continue
|
||||||
return
|
return
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
|
Loading…
Reference in New Issue