Skip to content

Commit

Permalink
Merge pull request #54 from HarrisChu/support_http2_lts
Browse files Browse the repository at this point in the history
support http2
  • Loading branch information
HarrisChu authored Jan 4, 2024
2 parents 509a486 + 5db262b commit 93f145f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type (
Username string `json:"username"`
Password string `json:"password"`
Space string `json:"space"`
UseHttp bool `json:"use_http"`
}

OutputOption struct {
Expand Down
5 changes: 5 additions & 0 deletions pkg/nebulagraph/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ func (gp *GraphPool) initConnectionPool() error {
return err
}
}
if gp.graphOption.UseHttp {
conf.UseHTTP2 = true
}

pool, err := graph.NewSslConnectionPool(hosts, conf, sslConfig, graph.DefaultLogger{})
if err != nil {
return err
Expand Down Expand Up @@ -217,6 +221,7 @@ func (gp *GraphPool) initSessionPool() error {
graph.WithMaxSize(gp.graphOption.MaxSize),
graph.WithMinSize(gp.graphOption.MinSize),
graph.WithSSLConfig(sslConfig),
graph.WithHTTP2(gp.graphOption.UseHttp),
)
if err != nil {
return err
Expand Down

0 comments on commit 93f145f

Please sign in to comment.