Skip to content

Commit 465a2b8

Browse files
committed
keep alive set to minutes
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent 0c44080 commit 465a2b8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

platform/fabricx/core/finality/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: 5 * time.Minute,
43+
ClientTimeout: 6 * time.Minute,
44+
})...)
3945

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

platform/fabricx/core/queryservice/grpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func GrpcClient(c *Config) (*grpc.ClientConn, error) {
3939
opts = append(opts, WithTLS(endpoint))
4040
opts = append(opts, grpc2.ClientKeepaliveOptions(
4141
grpc2.KeepaliveOptions{
42-
ClientInterval: 60 * time.Second,
42+
ClientInterval: 120 * time.Second,
4343
ClientTimeout: 600 * time.Second,
4444
})...)
4545

0 commit comments

Comments
 (0)