Skip to content

Commit

Permalink
fix(storage): remove uncertainty on car close
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahhoward committed May 25, 2023
1 parent 978f197 commit 3b48475
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pkg/storage/duplicateaddercar.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ func NewDuplicateAdderCarForStream(ctx context.Context, root cid.Cid, path strin
func (da *DuplicateAdderCar) addDupes() {
var err error
defer func() {
select {
case <-da.ctx.Done():
case da.streamCompletion <- err:
}
da.streamCompletion <- err
}()
sel := types.PathScopeSelector(da.path, da.scope)

Expand Down Expand Up @@ -114,12 +111,7 @@ func (da *DuplicateAdderCar) Close() error {
if streamCompletion == nil {
return nil
}
select {
case <-da.ctx.Done():
return da.ctx.Err()
case err := <-streamCompletion:
return err
}
return <-streamCompletion
}

type blockStream struct {
Expand Down

0 comments on commit 3b48475

Please sign in to comment.