From 90d30bde85e8fde1f576e87cdd43b2e2da534da7 Mon Sep 17 00:00:00 2001 From: sunchunming Date: Fri, 19 Nov 2021 11:36:00 +0800 Subject: [PATCH] optimize retry flag in Controller.Status function Signed-off-by: sunchunming --- control/control.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/control/control.go b/control/control.go index 11f2f67c7671b..c4840c273089b 100644 --- a/control/control.go +++ b/control/control.go @@ -333,8 +333,8 @@ func (c *Controller) Status(req *controlapi.StatusRequest, stream controlapi.Con return nil } logSize := 0 - retry := false for { + retry := false sr := controlapi.StatusResponse{} for _, v := range ss.Vertexes { sr.Vertexes = append(sr.Vertexes, &controlapi.Vertex{ @@ -374,8 +374,6 @@ func (c *Controller) Status(req *controlapi.StatusRequest, stream controlapi.Con ss.Logs = ss.Logs[i+1:] retry = true break - } else { - retry = false } } if err := stream.SendMsg(&sr); err != nil {