Skip to content

Commit

Permalink
fix: remove busyloop in blockservice
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorropo committed Mar 28, 2023
1 parent 5bbb21b commit 1cfd8cb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions blockservice/blockservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ func getBlocks(ctx context.Context, ks []cid.Cid, bs blockstore.Blockstore, fget
}

if !allValid {
// can't shift in place because we don't want to clobber callers.
ks2 := make([]cid.Cid, 0, len(ks))
for _, c := range ks {
// hash security
Expand Down Expand Up @@ -351,8 +352,6 @@ func getBlocks(ctx context.Context, ks []cid.Cid, bs blockstore.Blockstore, fget
batch = append(batch, b)
case <-ctx.Done():
return
default:
break batchLoop
}
}

Expand Down

0 comments on commit 1cfd8cb

Please sign in to comment.