Skip to content

Commit

Permalink
Fix concurrency bug
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianBland committed Aug 5, 2024
1 parent 3ec29f7 commit f7a57d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/replayor/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (r *Benchmark) loadBlocks(ctx context.Context) {
for i := uint64(0); i < concurrency; i++ {
blockNum := blockStartRange + i

go func(index uint64) {
go func(index, blockNum uint64) {
defer wg.Done()

block, err := r.getBlockFromSourceNode(ctx, blockNum)
Expand All @@ -81,7 +81,7 @@ func (r *Benchmark) loadBlocks(ctx context.Context) {
m.Lock()
results[index] = block
m.Unlock()
}(i)
}(i, blockNum)
}

wg.Wait()
Expand Down

0 comments on commit f7a57d1

Please sign in to comment.