From 805bbb766fd9c019f528e2f8ed1379d997622d03 Mon Sep 17 00:00:00 2001 From: larkee <31196561+larkee@users.noreply.github.com> Date: Thu, 16 Apr 2020 13:24:00 +1200 Subject: [PATCH] fix: add keepalive changes to synth.py (#55) Co-authored-by: larkee --- 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(