Skip to content

Commit

Permalink
Checkpoint.
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
  • Loading branch information
kevina committed Nov 15, 2016
1 parent bc21966 commit 4970133
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions blocks/blockstore/blockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ func (bs *blockstore) AllKeysChan(ctx context.Context) (<-chan *cid.Cid, error)
select {
case <-ctx.Done():
return nil, false
case e, more := <-res.Next():
if !more {
default:
e, ok := res.NextSync()
if !ok {
return nil, false
}
if e.Error != nil {
Expand All @@ -209,7 +210,7 @@ func (bs *blockstore) AllKeysChan(ctx context.Context) (<-chan *cid.Cid, error)
output := make(chan *cid.Cid, dsq.KeysOnlyBufSize)
go func() {
defer func() {
res.Process().Close() // ensure exit (signals early exit, too)
res.Close() // ensure exit (signals early exit, too)
close(output)
}()

Expand Down

0 comments on commit 4970133

Please sign in to comment.