Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
galen0624 committed Oct 23, 2018
1 parent c0fe13b commit 2bbc5d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion registry/consul/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type be struct {
func NewBackend(cfg *config.Consul) (registry.Backend, error) {
// create a reusable client
// Updated default Idle Connections setting to avoid TIME_WAIT issues
var httpTrans = &http.Transport{MaxIdleConnsPerHost: cfg.ConcurrentConsulRequests *2, MaxIdleConns: cfg.ConcurrentConsulRequests *2}
var httpTrans = &http.Transport{MaxIdleConnsPerHost: cfg.ConcurrentConsulRequests * 2, MaxIdleConns: cfg.ConcurrentConsulRequests * 2}
var httpClient = &http.Client{Transport: httpTrans}

c, err := api.NewClient(&api.Config{Address: cfg.Addr, Scheme: cfg.Scheme, Token: cfg.Token, HttpClient: httpClient})
Expand Down
5 changes: 4 additions & 1 deletion registry/consul/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +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(serviceChan)
log.Printf("AFTER CHAN CLOSE IS DONE %v", len(serviceChan))
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 2bbc5d0

Please sign in to comment.