mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-20 12:20:29 +08:00
added a condition to break out of the heartbeat on the initial loop, once all components report themselves once.
This commit is contained in:
@@ -289,6 +289,8 @@ class Controller(object):
|
||||
# Hearbeat Cycle
|
||||
# ==============
|
||||
|
||||
initializing = len(self.tracked) == 0 and len(self.finished) == 0
|
||||
|
||||
# Wait the responses
|
||||
while self.alive:
|
||||
|
||||
@@ -318,6 +320,13 @@ class Controller(object):
|
||||
log.info(repr(self.responses))
|
||||
break
|
||||
|
||||
# if this is the first time heartbeating, break
|
||||
# out early if we get everything tracked no need
|
||||
# to hold out for the full heartbeat.
|
||||
if initializing and len(self.responses) == len(self.topology):
|
||||
log.info("breaking out of initial heartbeat")
|
||||
break
|
||||
|
||||
# ================
|
||||
# Heartbeat Stats
|
||||
# ================
|
||||
|
||||
Reference in New Issue
Block a user