Skip to content

Commit

Permalink
issue fabiolb#558 added go routine for consul service calls
Browse files Browse the repository at this point in the history
  • Loading branch information
galen0624 committed Oct 23, 2018
1 parent 2bbc5d0 commit b52ba53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions registry/consul/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ func servicesConfig(client *api.Client, checks []*api.HealthCheck, tagPrefix str
//Call serviceConfig Go Routines for every service
for name, passing := range m {
serviceChan <- ServiceChannel{Client: client, Name: name, Passing: passing, TagPrefix: tagPrefix}
log.Printf("BEFORE LOOP IS DONE %v", len(serviceChan))
}
log.Printf("AFTER LOOP IS DONE %v", len(serviceChan))

//Close the Service Channel
close(serviceChan)
log.Printf("AFTER CHAN CLOSE IS DONE %v", len(serviceChan))

//Wait for remaining Go routines to finish
wg.Wait()
log.Printf("AFTER WAIT IS DONE %v", len(serviceChan))

// sort config in reverse order to sort most specific config to the top
sort.Sort(sort.Reverse(sort.StringSlice(config)))
Expand Down

0 comments on commit b52ba53

Please sign in to comment.