Skip to content

Commit

Permalink
fix: remove frequent pool status updates (#83)
Browse files Browse the repository at this point in the history
to reduce frequent pool updates, a pool status update is only done when
the longrunningidlerunners count has changed

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
  • Loading branch information
bavarianbidi committed Jan 23, 2024
1 parent 1334d0e commit 9e931ec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/controller/pool_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,11 @@ func (r *PoolReconciler) reconcileUpdate(ctx context.Context, garmClient garmCli
}

// update pool idle runners count in status
pool.Status.LongRunningIdleRunners = uint(longRunningIdleRunnersCount)
if err := r.updatePoolCRStatus(ctx, pool); err != nil {
return ctrl.Result{}, err
if pool.Status.LongRunningIdleRunners != uint(longRunningIdleRunnersCount) {
pool.Status.LongRunningIdleRunners = uint(longRunningIdleRunnersCount)
if err := r.updatePoolCRStatus(ctx, pool); err != nil {
return ctrl.Result{}, err
}
}

err = annotations.SetLastSyncTime(pool, r.Client)
Expand Down

0 comments on commit 9e931ec

Please sign in to comment.