From 361f0d996ce268f5ea6adf680bd8734e3e8cf366 Mon Sep 17 00:00:00 2001 From: Lenin Singaravelu Date: Wed, 3 Jul 2019 09:50:38 -0700 Subject: [PATCH] Stop cloudprober from starting gRPC server if a grpc listener is not created. PiperOrigin-RevId: 256386263 --- cloudprober.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudprober.go b/cloudprober.go index abae875a..a1e94c7b 100644 --- a/cloudprober.go +++ b/cloudprober.go @@ -199,7 +199,7 @@ func Start(ctx context.Context) { }() go srv.Serve(cloudProber.defaultServerLn) - if grpcSrv != nil { + if grpcSrv != nil && cloudProber.defaultGRPCLn != nil { go grpcSrv.Serve(cloudProber.defaultGRPCLn) }