Skip to content

Commit

Permalink
errgroup wait correction on idx add property
Browse files Browse the repository at this point in the history
  • Loading branch information
moogacs committed Apr 25, 2024
1 parent df2a66f commit b246329
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 4 additions & 3 deletions adapters/repos/db/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,12 @@ func (i *Index) addProperty(ctx context.Context, props ...*models.Property) erro

i.ForEachShard(func(key string, shard ShardLike) error {
shard.createPropertyIndex(ctx, eg, props...)
if err := eg.Wait(); err != nil {
return errors.Wrapf(err, "extend idx '%s' with properties '%v", i.ID(), props)
}
return nil
})

if err := eg.Wait(); err != nil {
return errors.Wrapf(err, "extend idx '%s' with properties '%v", i.ID(), props)
}
return nil
}

Expand Down
4 changes: 0 additions & 4 deletions adapters/repos/db/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,10 +757,6 @@ func (s *Shard) createPropertyIndex(ctx context.Context, eg *enterrors.ErrorGrou

return nil
})

if err := eg.Wait(); err != nil {
return err
}
}
return nil
}
Expand Down

0 comments on commit b246329

Please sign in to comment.