From 55398ea92b25d18317d4a5d2116155438d9eada5 Mon Sep 17 00:00:00 2001 From: Ahmed Ezzat Date: Mon, 18 Sep 2023 18:11:18 +0300 Subject: [PATCH] Log if necessary --- dask_kubernetes/operator/controller/controller.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dask_kubernetes/operator/controller/controller.py b/dask_kubernetes/operator/controller/controller.py index 0788b8667..e8baff1e3 100644 --- a/dask_kubernetes/operator/controller/controller.py +++ b/dask_kubernetes/operator/controller/controller.py @@ -600,9 +600,10 @@ async def daskworkergroup_replica_update( if not worker.ready() and len(pending_workers) <= -workers_needed: pending_workers.append(worker) - logger.info(f"Pending worker deployments to delete: {pending_workers}") - for worker in pending_workers: - await worker.delete() + if pending_workers: + logger.info(f"Pending worker deployments to delete: {pending_workers}") + for worker in pending_workers: + await worker.delete() n_workers = -workers_needed - len(pending_workers) if n_workers > 0: