Skip to content

Commit

Permalink
Merge pull request #74 from ipfs/fix/close-query-on-move
Browse files Browse the repository at this point in the history
fix: close query when finished moving
  • Loading branch information
Stebalien committed Apr 10, 2020
2 parents 8e4cd22 + a7dbfb2 commit 8a9ada9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ func Move(oldPath string, newPath string, out io.Writer) error {
break
}
if e.Error != nil {
res.Close()
return e.Error
}

err := moveKey(oldDS, newDS, datastore.RawKey(e.Key))
if err != nil {
res.Close()
return err
}

Expand All @@ -89,6 +91,7 @@ func Move(oldPath string, newPath string, out io.Writer) error {
fmt.Fprintf(out, "\r%d keys so far", count)
}
}
res.Close()

if out != nil {
fmt.Fprintf(out, "\nCleaning Up...\n")
Expand Down

0 comments on commit 8a9ada9

Please sign in to comment.