If a org is missing then don't add it to list
Requests to /me and deleting organization can result in a race conditionpull/10616/head
parent
4a8500d9f1
commit
a39696c549
|
@ -380,6 +380,13 @@ func (s *Service) usersOrganizations(ctx context.Context, u *chronograf.User) ([
|
||||||
orgs := []chronograf.Organization{}
|
orgs := []chronograf.Organization{}
|
||||||
for orgID, _ := range orgIDs {
|
for orgID, _ := range orgIDs {
|
||||||
org, err := s.Store.Organizations(ctx).Get(ctx, chronograf.OrganizationQuery{ID: &orgID})
|
org, err := s.Store.Organizations(ctx).Get(ctx, chronograf.OrganizationQuery{ID: &orgID})
|
||||||
|
|
||||||
|
// There can be race conditions between deleting a organization and the me query
|
||||||
|
if err == chronograf.ErrOrganizationNotFound {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// Any other error should cause an error to be returned
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue