|
|
@ -29,7 +29,7 @@ func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server { |
|
|
|
Time: 10 * time.Second, // wait time before ping if no activity
|
|
|
|
Timeout: 20 * time.Second, // ping timeout
|
|
|
|
}), grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ |
|
|
|
MinTime: 60 * time.Second, // min time a client should wait before sending a ping
|
|
|
|
MinTime: 60 * time.Second, // min time a client should wait before sending a ping
|
|
|
|
PermitWithoutStream: true, |
|
|
|
})) |
|
|
|
for _, opt := range opts { |
|
|
@ -47,8 +47,8 @@ func GrpcDial(ctx context.Context, address string, opts ...grpc.DialOption) (*gr |
|
|
|
options = append(options, |
|
|
|
// grpc.WithInsecure(),
|
|
|
|
grpc.WithKeepaliveParams(keepalive.ClientParameters{ |
|
|
|
Time: 30 * time.Second, // client ping server if no activity for this long
|
|
|
|
Timeout: 20 * time.Second, |
|
|
|
Time: 30 * time.Second, // client ping server if no activity for this long
|
|
|
|
Timeout: 20 * time.Second, |
|
|
|
PermitWithoutStream: true, |
|
|
|
})) |
|
|
|
for _, opt := range opts { |
|
|
|