Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
process all hosted zones
Browse files Browse the repository at this point in the history
  • Loading branch information
ideahitme committed Dec 21, 2016
1 parent 9d637f9 commit f310d57
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions consumers/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,16 @@ func (a *awsClient) Sync(endpoints []*pkg.Endpoint) error {

var wg sync.WaitGroup
for zoneName, zoneID := range hostedZonesMap {
if len(inputByZoneID[zoneID]) > 0 {
wg.Add(1)
zoneID := zoneID
go func() {
defer wg.Done()
err := a.syncPerHostedZone(inputByZoneID[zoneID], zoneID)
if err != nil {
//should pass the err down the error channel
//for now just log
log.Errorf("Error changing records per zone: %s", zoneName)
}
}()
}
wg.Add(1)
go func(zoneName, zoneID string) {
defer wg.Done()
err := a.syncPerHostedZone(inputByZoneID[zoneID], zoneID)
if err != nil {
//should pass the err down the error channel
//for now just log
log.Errorf("Error changing records per zone: %s", zoneName)
}
}(zoneName, zoneID)
}
wg.Wait()
return nil
Expand Down Expand Up @@ -150,7 +147,7 @@ func (a *awsClient) syncPerHostedZone(newAliasRecords []*route53.ResourceRecordS
return a.client.ChangeRecordSets(upsert, del, nil, zoneID)
}

log.Infoln("No changes submitted")
log.Infoln("No changes submitted for zone: ", zoneID)
return nil
}

Expand Down

0 comments on commit f310d57

Please sign in to comment.