From f7b89cedc39a866073a16f4de4c9ef01d1e73035 Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Tue, 16 Jun 2026 09:47:03 +0200 Subject: [PATCH] Sponsor: set gRPC client idle timeout (#30913) --- util/cloud/client.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/cloud/client.go b/util/cloud/client.go index 414da155f..5fae0b06a 100644 --- a/util/cloud/client.go +++ b/util/cloud/client.go @@ -4,6 +4,7 @@ import ( "crypto/tls" _ "embed" "net" + "time" "github.com/evcc-io/evcc/util" "google.golang.org/grpc" @@ -29,7 +30,11 @@ func Connection() (*grpc.ClientConn, error) { creds := credentials.NewTLS(&tls.Config{ ServerName: host, }) - conn, err = grpc.Dial(hostport, grpc.WithTransportCredentials(creds)) + // close idle connection shortly after startup auth instead of churning against the server's idle close + conn, err = grpc.NewClient(hostport, + grpc.WithTransportCredentials(creds), + grpc.WithIdleTimeout(5*time.Second), + ) return conn, err }