e3: reduce buildIndex ctx scope (#889)

This commit is contained in:
Alex Sharov 2023-02-12 16:24:16 +07:00 committed by GitHub
parent e57fe47ffb
commit e647e5fe3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -215,6 +215,7 @@ func (a *AggregatorV3) BuildOptionalMissedIndices(ctx context.Context, workers i
} }
func (a *AggregatorV3) BuildMissedIndices(ctx context.Context, sem *semaphore.Weighted) error { func (a *AggregatorV3) BuildMissedIndices(ctx context.Context, sem *semaphore.Weighted) error {
{
g, ctx := errgroup.WithContext(ctx) g, ctx := errgroup.WithContext(ctx)
if a.accounts != nil { if a.accounts != nil {
g.Go(func() error { return a.accounts.BuildMissedIndices(ctx, sem) }) g.Go(func() error { return a.accounts.BuildMissedIndices(ctx, sem) })
@ -241,6 +242,7 @@ func (a *AggregatorV3) BuildMissedIndices(ctx context.Context, sem *semaphore.We
if err := g.Wait(); err != nil { if err := g.Wait(); err != nil {
return err return err
} }
}
return a.BuildOptionalMissedIndices(ctx, 4) return a.BuildOptionalMissedIndices(ctx, 4)
} }