Skip to content

Commit

Permalink
fix NewTCClient (#24)
Browse files Browse the repository at this point in the history
Co-authored-by: whitefox <[email protected]>
  • Loading branch information
kmlebedev and whitefox authored Dec 9, 2024
1 parent 190ea39 commit 096eeb9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"fmt"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials/insecure"
"io"
"os"
"strings"
Expand Down Expand Up @@ -88,12 +90,14 @@ func NewTCClient() (*TCClient, error) {
log.Infoln("gRPC client running ...")
conn, err := grpc.NewClient(
os.Getenv("TC_TARGET"),
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(grpc.WaitForReady(true)),
)
if err != nil {
log.Error("grpc.Dial()", err)
return nil, err
}
conn.WaitForStateChange(context.Background(), connectivity.Ready)
client := pb.NewConnectServiceClient(conn)
return NewTCClientWithConn(client, conn)
}
Expand Down
7 changes: 4 additions & 3 deletions proto/connect.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/connect.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

option go_package = "github.com/kmlebedev/txmlconnector/proto";
option go_package = "github.com/kmlebedev/txmlconnector/transaqConnector";
package transaqConnector;

message DataRequest {
Expand Down
2 changes: 1 addition & 1 deletion proto/connect_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 096eeb9

Please sign in to comment.