From 2933882f9738fcfd1cf022c44538f3474ef4e752 Mon Sep 17 00:00:00 2001 From: HarrisChu <1726587+HarrisChu@users.noreply.github.com> Date: Fri, 18 Aug 2023 18:22:52 +0800 Subject: [PATCH] fix connection pool --- pkg/nebulagraph/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/nebulagraph/client.go b/pkg/nebulagraph/client.go index 5ebbd9f..f1b6dda 100644 --- a/pkg/nebulagraph/client.go +++ b/pkg/nebulagraph/client.go @@ -149,6 +149,8 @@ func (gp *GraphPool) initConnectionPool() error { } gp.clients = make([]common.IGraphClient, 0, gp.graphOption.MaxSize) conf := graph.GetDefaultConf() + conf.MaxConnPoolSize = gp.graphOption.MaxSize + conf.MinConnPoolSize = gp.graphOption.MinSize conf.TimeOut = time.Duration(gp.graphOption.TimeoutUs) * time.Microsecond conf.IdleTime = time.Duration(gp.graphOption.IdleTimeUs) * time.Microsecond var sslConfig *tls.Config @@ -329,7 +331,6 @@ func (gc *GraphClient) executeRetry(stmt string) (*graph.ResultSet, error) { ) start := time.Now() for i := 0; i < gc.Pool.graphOption.RetryTimes+1; i++ { - if gc.Client != nil { resp, err = gc.Client.Execute(stmt) } else {