Skip to content

Commit

Permalink
update: use NewClient instead of Dial
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianToledano committed Aug 7, 2024
1 parent 46c0423 commit eaf3f7b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client_online.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func NewClient(cfg *Config) (*Client, error) {

// Bootstrap is gonna connect the client to the endpoints
func (c *Client) Bootstrap() error {
grpcConn, err := grpc.Dial(c.config.GRPCEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials()))
grpcConn, err := grpc.NewClient(c.config.GRPCEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return crgerrs.WrapError(crgerrs.ErrOnlineClient, fmt.Sprintf("dialing grpc endpoint %s", err.Error()))
}
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ require (
github.com/klauspost/compress v1.17.7 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.8.14 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand Down
2 changes: 1 addition & 1 deletion load.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func openClient(endpoint string) (client *grpc.ClientConn, err error) {
MinVersion: tls.VersionTLS12,
})

client, err = grpc.Dial(endpoint, grpc.WithTransportCredentials(tlsCredentials))
client, err = grpc.NewClient(endpoint, grpc.WithTransportCredentials(tlsCredentials))
if err != nil {
return nil, crgerrs.WrapError(crgerrs.ErrClient, fmt.Sprintf("getting grpc client connection %s", err.Error()))
}
Expand Down

0 comments on commit eaf3f7b

Please sign in to comment.