From b6a788373b882b5e5f015b224a3fa9cd7a3da982 Mon Sep 17 00:00:00 2001 From: neza2017 Date: Tue, 26 Jan 2021 16:30:36 +0800 Subject: [PATCH] Fix proxy server Signed-off-by: neza2017 --- internal/distributed/proxyservice/client.go | 8 ++++++++ internal/proxyservice/timetick.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/distributed/proxyservice/client.go b/internal/distributed/proxyservice/client.go index d53b9c83f2..cd99aaac6f 100644 --- a/internal/distributed/proxyservice/client.go +++ b/internal/distributed/proxyservice/client.go @@ -49,6 +49,10 @@ func (c *Client) InvalidateCollectionMetaCache(request *proxypb.InvalidateCollMe } func (c *Client) GetTimeTickChannel() (string, error) { + err := c.tryConnect() + if err != nil { + return "", err + } response, err := c.proxyServiceClient.GetTimeTickChannel(c.ctx, &commonpb.Empty{}) if err != nil { return "", err @@ -57,6 +61,10 @@ func (c *Client) GetTimeTickChannel() (string, error) { } func (c *Client) GetComponentStates() (*internalpb2.ComponentStates, error) { + err := c.tryConnect() + if err != nil { + return nil, err + } return c.proxyServiceClient.GetComponentStates(c.ctx, &commonpb.Empty{}) } diff --git a/internal/proxyservice/timetick.go b/internal/proxyservice/timetick.go index e9181a682c..e150e9cf54 100644 --- a/internal/proxyservice/timetick.go +++ b/internal/proxyservice/timetick.go @@ -35,7 +35,7 @@ func (tt *TimeTickImpl) Start() error { select { case <-tt.ctx.Done(): log.Println("time tick loop was canceled by context!") - break + return default: current, err := tt.ttBarrier.GetTimeTick() if err != nil {