Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

update pools before nodes or scalesets #503

Merged
merged 3 commits into from
Feb 4, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/api-service/__app__/timer_workers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ def process_scaleset(scaleset: Scaleset) -> None:


def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa: F841
pools = Pool.search()
bmc-msft marked this conversation as resolved.
Show resolved Hide resolved
for pool in pools:
if pool.state in PoolState.needs_work():
logging.info("update pool: %s (%s)", pool.pool_id, pool.name)
process_state_updates(pool)
elif pool.state in PoolState.available() and pool.autoscale:
autoscale_pool(pool)

Node.mark_outdated_nodes()
nodes = Node.search_states(states=NodeState.needs_work())
for node in nodes:
Expand All @@ -38,14 +46,6 @@ def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa:
for scaleset in scalesets:
process_scaleset(scaleset)

pools = Pool.search()
for pool in pools:
if pool.state in PoolState.needs_work():
logging.info("update pool: %s (%s)", pool.pool_id, pool.name)
process_state_updates(pool)
elif pool.state in PoolState.available() and pool.autoscale:
autoscale_pool(pool)

events = get_events()
if events:
dashboard.set(events)