From f97b09a85dbf7f35fefd228b594494d118303c76 Mon Sep 17 00:00:00 2001 From: larkee Date: Tue, 14 Apr 2020 16:06:58 +1000 Subject: [PATCH] fix: add keepalive changes to synth.py --- synth.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/synth.py b/synth.py index c509089401..a351bbf943 100644 --- a/synth.py +++ b/synth.py @@ -46,7 +46,14 @@ s.replace( "google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py", "from google.cloud.spanner_v1.proto import spanner_pb2_grpc\n", - "\g<0>\n\n_SPANNER_GRPC_CONFIG = 'spanner.grpc.config'\n", + "\g<0>\n\n_GRPC_KEEPALIVE_MS = 2 * 60 * 1000\n" + "_SPANNER_GRPC_CONFIG = 'spanner.grpc.config'\n", +) + +s.replace( + "google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py", + "(\s+)'grpc.max_receive_message_length': -1,", + "\g<0>\g<1>\"grpc.keepalive_time_ms\": _GRPC_KEEPALIVE_MS,", ) s.replace(