Skip to content

Commit dfbc656

Browse files
authored
fix: add keepalive to gRPC channel (#49)
Co-authored-by: larkee <larkee@users.noreply.github.com>
1 parent 430ca32 commit dfbc656

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from google.cloud.spanner_v1.proto import spanner_pb2_grpc
2424

2525

26+
_GRPC_KEEPALIVE_MS = 2 * 60 * 1000
2627
_SPANNER_GRPC_CONFIG = "spanner.grpc.config"
2728

2829

@@ -73,6 +74,7 @@ def __init__(
7374
options={
7475
"grpc.max_send_message_length": -1,
7576
"grpc.max_receive_message_length": -1,
77+
"grpc.keepalive_time_ms": _GRPC_KEEPALIVE_MS,
7678
}.items(),
7779
)
7880

0 commit comments

Comments
 (0)