From 46d83f235efa0a27ab3b71f67752ac8332f620ec Mon Sep 17 00:00:00 2001 From: Umputun Date: Sun, 11 Apr 2021 14:21:58 -0500 Subject: [PATCH] don't run discovery if no providers --- app/main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/main.go b/app/main.go index 162813a..97150f8 100644 --- a/app/main.go +++ b/app/main.go @@ -97,11 +97,13 @@ func main() { } svc := discovery.NewService(providers) - go func() { - if e := svc.Run(context.Background()); e != nil { - log.Fatalf("[ERROR] discovery failed, %v", e) - } - }() + if len(providers) > 0 { + go func() { + if e := svc.Run(context.Background()); e != nil { + log.Fatalf("[ERROR] discovery failed, %v", e) + } + }() + } sslConfig, err := makeSSLConfig() if err != nil {