From 935cb6762578888a84681f4bf6c855a3581e7095 Mon Sep 17 00:00:00 2001 From: Arunesh Dwivedi Date: Sun, 4 Oct 2026 21:26:14 +0530 Subject: [PATCH] fix(controller): use reasonable polling interval instead of time.Nanosecond A polling interval of time.Nanosecond is effectively a busy loop that consumes excessive CPU. Use time.Second as a reasonable minimum. Signed-off-by: Arunesh Dwivedi --- controllers/imagejob/imagejob_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/imagejob/imagejob_controller.go b/controllers/imagejob/imagejob_controller.go index b20f7cc0da..4c7d213de0 100644 --- a/controllers/imagejob/imagejob_controller.go +++ b/controllers/imagejob/imagejob_controller.go @@ -431,7 +431,7 @@ func (r *Reconciler) handleNewJob(ctx context.Context, imageJob *eraserv1.ImageJ for _, namespacedName := range namespacedNames { //nolint:staticcheck // SA1019: TODO: Replace with PollUntilContextTimeout in future refactor - if err := wait.PollImmediate(time.Nanosecond, time.Minute*5, r.isPodReady(ctx, namespacedName)); err != nil { + if err := wait.PollImmediate(time.Second, time.Minute*5, r.isPodReady(ctx, namespacedName)); err != nil { log.Error(err, "timed out waiting for pod to leave pending state", "pod NamespacedName", namespacedName) } }