Skip to content

Commit

Permalink
Revert "temp-fix: strawman for #374"
Browse files Browse the repository at this point in the history
This reverts commit 85eb065df81f0ab2688530772c72f078344c9bab.
  • Loading branch information
frrist committed Feb 18, 2021
1 parent ee65592 commit 4a9b539
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chain/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,15 @@ func (t *TipSetIndexer) TipSet(ctx context.Context, ts *types.TipSet) error {
}

// Persist all results
var wg sync.WaitGroup
wg.Add(len(taskOutputs))
go func() {
// free up the slot when done
defer func() {
<-t.persistSlot
}()

ll.Debugw("persisting data", "time", time.Since(start))
var wg sync.WaitGroup
wg.Add(len(taskOutputs))

// Persist each processor's data concurrently since they don't overlap
for task, p := range taskOutputs {
Expand All @@ -356,9 +356,9 @@ func (t *TipSetIndexer) TipSet(ctx context.Context, ts *types.TipSet) error {
ll.Debugw("task data persisted", "task", task, "time", time.Since(start))
}(task, p)
}
wg.Wait()
ll.Debugw("tipset complete", "total_time", time.Since(start))
}()
wg.Wait()

return nil
}
Expand Down

0 comments on commit 4a9b539

Please sign in to comment.