Fix queryservice connect error (#5526)

Signed-off-by: godchen <qingxiang.chen@zilliz.com>
This commit is contained in:
godchen 2021-06-01 17:46:32 +08:00 committed by zhenshan.cao
parent fca3eb7126
commit 54ab03e28f

View File

@ -79,6 +79,8 @@ func (c *Client) Init() error {
log.Debug("QueryServiceClient try connect QueryService", zap.Any("c.addr", c.addr))
if c.addr != "" {
connectGrpcFunc := func() error {
ctx, cancel := context.WithTimeout(context.Background(), c.timeout)
defer cancel()
ctx, cancelFunc := context.WithTimeout(c.ctx, c.timeout)
defer cancelFunc()
log.Debug("QueryServiceClient try connect ", zap.String("address", c.addr))