Skip to content

Commit

Permalink
fix: close query when finished moving
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Apr 10, 2020
1 parent 2284a52 commit a7dbfb2
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 a7dbfb2

Please sign in to comment.