From 4fd53ba541e0b6344199cc896bc01725f0077e9a Mon Sep 17 00:00:00 2001 From: Alan Sebastian Date: Sat, 16 Jun 2018 11:34:23 -0700 Subject: [PATCH] Return on consul watcher errors --- watchers/consul/consul.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/watchers/consul/consul.go b/watchers/consul/consul.go index 01e40f8..7c338fc 100644 --- a/watchers/consul/consul.go +++ b/watchers/consul/consul.go @@ -66,6 +66,7 @@ func Sync(t time.Time) { client, err := api.NewClient(consulConfig) if err != nil { log.Errorf("Consul error: %v\n", err) + return } catalog := client.Catalog() @@ -73,6 +74,7 @@ func Sync(t time.Time) { services, _, err := catalog.Services(&qo) if err != nil { log.Errorf("Catalog/services error: %v", err) + return } var wg sync.WaitGroup @@ -110,6 +112,7 @@ func getServiceHealth(key string, client *api.Client, qo api.QueryOptions, m *sy sh, _, err := h.Service(key, "", true, &qo) if err != nil { log.Errorf("Failed to find service: %v", err) + return } for _, element := range sh {