Skip to content

Commit

Permalink
Merge pull request #51 from HarrisChu/fix_connection_pool
Browse files Browse the repository at this point in the history
fix connection pool
  • Loading branch information
HarrisChu authored Aug 18, 2023
2 parents 09a9585 + 2933882 commit 1355d16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/nebulagraph/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1355d16

Please sign in to comment.