Skip to content

Commit

Permalink
[merge] pull request #1385
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelMoll committed Nov 10, 2016
2 parents e864b5c + 31bd069 commit 0b5198f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
1 change: 0 additions & 1 deletion api/models/app.go
Expand Up @@ -34,7 +34,6 @@ type Apps []App

func ListApps() (Apps, error) {
res, err := DescribeStacks()

if err != nil {
return nil, err
}
Expand Down
22 changes: 18 additions & 4 deletions api/models/system.go
Expand Up @@ -61,13 +61,27 @@ func doDescribeStack(input cloudformation.DescribeStacksInput) (*cloudformation.
if s.RequestTime.Before(time.Now().Add(-DescribeStacksCacheTTL)) || os.Getenv("PROVIDER") == "test" {
log.Logf("name=%q age=%s status=miss", name, time.Since(s.RequestTime))

res, err := CloudFormation().DescribeStacks(&input)
var err error
var res *cloudformation.DescribeStacksOutput
var stacks []*cloudformation.Stack

if err != nil {
log.Namespace("name=%q", name).Error(err)
return nil, err
for {
res, err = CloudFormation().DescribeStacks(&input)
if err != nil {
log.Namespace("name=%q", name).Error(err)
return nil, err
}

stacks = append(stacks, res.Stacks...)

if res.NextToken == nil {
break
}

input.NextToken = res.NextToken
}

res.Stacks = stacks
DescribeStacksCache[name] = DescribeStacksResult{
Name: name,
Output: res,
Expand Down

0 comments on commit 0b5198f

Please sign in to comment.