Skip to content

Commit

Permalink
fix: do not close grpc connection
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelosousa committed Aug 22, 2022
1 parent 46d21cd commit a70503c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions go/clients/semantic.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ import (
"google.golang.org/grpc/credentials/insecure"
)

func NewSemanticClient(endpoint string) (services.SemanticClient, error) {
func NewSemanticClient(endpoint string) (services.SemanticClient, *grpc.ClientConn, error) {
defaultOptions := grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(419430400))
transportCredentials := grpc.WithTransportCredentials(insecure.NewCredentials())

semanticConnection, err := grpc.Dial(endpoint, transportCredentials, defaultOptions)
if err != nil {
return nil, err
return nil, nil, err
}
defer semanticConnection.Close()

semanticClient := services.NewSemanticClient(semanticConnection)

return semanticClient, nil
return semanticClient, semanticConnection, nil
}

0 comments on commit a70503c

Please sign in to comment.