Skip to content

Commit 769bf3a

Browse files
committed
keep alive options
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent de5937a commit 769bf3a

File tree

1 file changed

+6
-0
lines changed
  • platform/fabricx/core/queryservice

1 file changed

+6
-0
lines changed

platform/fabricx/core/queryservice/grpc.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"time"
1212

1313
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
14+
grpc2 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/grpc"
1415
"google.golang.org/grpc"
1516
"google.golang.org/grpc/backoff"
1617
"google.golang.org/grpc/credentials"
@@ -36,6 +37,11 @@ func GrpcClient(c *Config) (*grpc.ClientConn, error) {
3637
var opts []grpc.DialOption
3738
opts = append(opts, WithConnectionTime(endpoint.ConnectionTimeout))
3839
opts = append(opts, WithTLS(endpoint))
40+
opts = append(opts, grpc2.ClientKeepaliveOptions(
41+
grpc2.KeepaliveOptions{
42+
ClientInterval: 60 * time.Second,
43+
ClientTimeout: 600 * time.Second,
44+
})...)
3945

4046
return grpc.NewClient(endpoint.Address, opts...)
4147
}

0 commit comments

Comments
 (0)