Skip to content

Commit

Permalink
Return on consul watcher errors
Browse files Browse the repository at this point in the history
  • Loading branch information
asebastian committed Jun 16, 2018
1 parent 3c51e63 commit 4fd53ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions watchers/consul/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ func Sync(t time.Time) {
client, err := api.NewClient(consulConfig)
if err != nil {
log.Errorf("Consul error: %v\n", err)
return
}

catalog := client.Catalog()
qo := api.QueryOptions{}
services, _, err := catalog.Services(&qo)
if err != nil {
log.Errorf("Catalog/services error: %v", err)
return
}

var wg sync.WaitGroup
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 4fd53ba

Please sign in to comment.