From 68963becae181b3a4b2173441dba375f17caa1ad Mon Sep 17 00:00:00 2001 From: yuyi Date: Thu, 26 Sep 2024 11:14:43 +0800 Subject: [PATCH] fix(tenantop): move time.Sleep to the end of loop --- internal/resource/obtenantoperation/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/resource/obtenantoperation/utils.go b/internal/resource/obtenantoperation/utils.go index 5c56cba2b..31f1ad10c 100644 --- a/internal/resource/obtenantoperation/utils.go +++ b/internal/resource/obtenantoperation/utils.go @@ -89,7 +89,6 @@ func (m *ObTenantOperationManager) waitForOBTenantToBeStatus(waitSeconds int, ma return errors.New("target tenant is nil") } for i := 0; i < waitSeconds; i++ { - time.Sleep(time.Second) tenant := &v1alpha1.OBTenant{} err := m.Client.Get(m.Ctx, types.NamespacedName{ Namespace: m.Resource.Namespace, @@ -101,6 +100,7 @@ func (m *ObTenantOperationManager) waitForOBTenantToBeStatus(waitSeconds int, ma if matcher(tenant) { return nil } + time.Sleep(time.Second) } return errors.Errorf("wait for tenant %s to be in desired status timeout", m.Resource.Name) }