Skip to content

Commit

Permalink
fix: keystone project resource count not accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiu Jian committed Jun 23, 2020
1 parent 965b51c commit 161db6d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/keystone/cronjobs/project_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,15 @@ func syncScopeResourceCount(ctx context.Context, regionId string, serviceId stri
scopeRes.Resource = res
scopeRes.Count = resCnts[i].ResCount

projList = append(projList, scopeRes.ProjectId)
domainList = append(domainList, scopeRes.DomainId)
ownerList = append(ownerList, scopeRes.OwnerId)
if len(scopeRes.ProjectId) > 0 {
projList = append(projList, scopeRes.ProjectId)
}
if len(scopeRes.DomainId) > 0 {
domainList = append(domainList, scopeRes.DomainId)
}
if len(scopeRes.OwnerId) > 0 {
ownerList = append(ownerList, scopeRes.OwnerId)
}

err := models.ScopeResourceManager.TableSpec().InsertOrUpdate(ctx, &scopeRes)
if err != nil {
Expand Down

0 comments on commit 161db6d

Please sign in to comment.