Skip to content

Commit

Permalink
fix: allow multiple errors to to return
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Aug 17, 2017
1 parent cb4628f commit 4e8803f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pin/gc/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ func GC(ctx context.Context, bs bstore.GCBlockstore, ls dag.LinkService, pn pin.
if err != nil {
output <- Result{Error: err}
criticalError = ErrCannotFetchAllLinks
return
}
if finished {
break
}
}
if criticalError != nil {
return
}

// Add white objects
keychan, err := bs.AllKeysChan(ctx)
Expand Down Expand Up @@ -156,13 +158,16 @@ func GC(ctx context.Context, bs bstore.GCBlockstore, ls dag.LinkService, pn pin.
if err != nil {
output <- Result{Error: err}
criticalError = ErrCannotFetchAllLinks
return
}
if finished {
break
}
}

if criticalError != nil {
return
}

emark.Done()
esweep := log.EventBegin(ctx, "GC.sweep")

Expand Down

0 comments on commit 4e8803f

Please sign in to comment.