From f85fa9ac545dc3ab2d14a523b6160ba5b01061bc Mon Sep 17 00:00:00 2001 From: Pavel Khripkov <94828791+PavelKhripkov@users.noreply.github.com> Date: Mon, 24 Apr 2023 18:25:25 +0300 Subject: [PATCH] remove-direct-connection-for-pbm-pitr-switch. (#2041) --- agent/client/pbm.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agent/client/pbm.go b/agent/client/pbm.go index 0b61716f09..3534b9d76f 100644 --- a/agent/client/pbm.go +++ b/agent/client/pbm.go @@ -19,6 +19,7 @@ import ( "os/exec" "path/filepath" "strconv" + "strings" "time" "github.com/pkg/errors" @@ -40,6 +41,9 @@ func (c *Client) handlePBMSwitchRequest(ctx context.Context, req *agentpb.PBMSwi return errors.WithStack(err) } + // TODO following line is a quick patch. Come up with something better. + dsn = strings.Replace(dsn, "directConnection=true", "directConnection=false", 1) + ctx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel()