Skip to content

Commit

Permalink
check ctx.Done in database.IndexDatabaseWithIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisaaronland committed Oct 5, 2021
1 parent 5e5e326 commit 6015543
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions database/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ func IndexDatabaseWithIterator(ctx context.Context, db SpatialDatabase, iterator

iter_cb := func(ctx context.Context, path string, fh io.ReadSeeker, args ...interface{}) error {

select {
case <-ctx.Done():
return nil
default:
// pass
}

body, err := io.ReadAll(fh)

if err != nil {
Expand Down

0 comments on commit 6015543

Please sign in to comment.