Skip to content

Commit 1355d16

Browse files
authored
Merge pull request #51 from HarrisChu/fix_connection_pool
fix connection pool
2 parents 09a9585 + 2933882 commit 1355d16

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/nebulagraph/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ func (gp *GraphPool) initConnectionPool() error {
149149
}
150150
gp.clients = make([]common.IGraphClient, 0, gp.graphOption.MaxSize)
151151
conf := graph.GetDefaultConf()
152+
conf.MaxConnPoolSize = gp.graphOption.MaxSize
153+
conf.MinConnPoolSize = gp.graphOption.MinSize
152154
conf.TimeOut = time.Duration(gp.graphOption.TimeoutUs) * time.Microsecond
153155
conf.IdleTime = time.Duration(gp.graphOption.IdleTimeUs) * time.Microsecond
154156
var sslConfig *tls.Config
@@ -329,7 +331,6 @@ func (gc *GraphClient) executeRetry(stmt string) (*graph.ResultSet, error) {
329331
)
330332
start := time.Now()
331333
for i := 0; i < gc.Pool.graphOption.RetryTimes+1; i++ {
332-
333334
if gc.Client != nil {
334335
resp, err = gc.Client.Execute(stmt)
335336
} else {

0 commit comments

Comments
 (0)