Skip to content

Commit

Permalink
Add a transitions_maxed() method to the monitor thread class
Browse files Browse the repository at this point in the history
Just for better caller method readability.
  • Loading branch information
cvaroqui committed Dec 17, 2019
1 parent cc08fd3 commit c242536
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/osvcd_mon.py
Expand Up @@ -758,12 +758,7 @@ def orchestrator(self):
self.get_agg_services()
for path in paths:
self.clear_start_failed(path)
transitions = self.transition_count()
if transitions > shared.NODE.max_parallel:
self.duplog("info", "delay services orchestration: "
"%(transitions)d/%(max)d transitions already "
"in progress", transitions=transitions,
max=shared.NODE.max_parallel)
if self.transitions_maxed():
break
if self.status_older_than_cf(path):
#self.log.info("%s status dump is older than its config file",
Expand All @@ -775,6 +770,16 @@ def orchestrator(self):
self.service_orchestrator(path, svc)
self.sync_services_conf()

def transitions_maxed(self):
transitions = self.transition_count()
if transitions <= shared.NODE.max_parallel:
return False
self.duplog("info", "delay services orchestration: "
"%(transitions)d/%(max)d transitions already "
"in progress", transitions=transitions,
max=shared.NODE.max_parallel)
return True

def resources_orchestrator(self, path, svc):
if shared.NMON_DATA.status == "shutting":
return
Expand Down

0 comments on commit c242536

Please sign in to comment.