Update zookeeper inside keepalive start

If nodes reconnect to ZK, this way they update immediately too.
This commit is contained in:
Joshua Boniface 2019-03-17 12:52:23 -04:00
parent 3df8365851
commit 3924586eb5
1 changed files with 2 additions and 2 deletions

View File

@ -81,6 +81,7 @@ def startKeepaliveTimer():
logger.out('Starting keepalive timer ({} second interval)'.format(interval), state='s') logger.out('Starting keepalive timer ({} second interval)'.format(interval), state='s')
update_timer.add_job(update_zookeeper, 'interval', seconds=interval) update_timer.add_job(update_zookeeper, 'interval', seconds=interval)
update_timer.start() update_timer.start()
update_zookeeper()
return update_timer return update_timer
def stopKeepaliveTimer(): def stopKeepaliveTimer():
@ -1119,9 +1120,8 @@ def update_zookeeper():
) )
# Start keepalive thread and immediately update Zookeeper # Start keepalive thread
update_timer = startKeepaliveTimer() update_timer = startKeepaliveTimer()
update_zookeeper()
# Tick loop; does nothing since everything else is async # Tick loop; does nothing since everything else is async
while True: while True: