Unverified Commit 8a9ada91 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #74 from ipfs/fix/close-query-on-move

fix: close query when finished moving
parents 8e4cd220 a7dbfb26
...@@ -76,11 +76,13 @@ func Move(oldPath string, newPath string, out io.Writer) error { ...@@ -76,11 +76,13 @@ func Move(oldPath string, newPath string, out io.Writer) error {
break break
} }
if e.Error != nil { if e.Error != nil {
res.Close()
return e.Error return e.Error
} }
err := moveKey(oldDS, newDS, datastore.RawKey(e.Key)) err := moveKey(oldDS, newDS, datastore.RawKey(e.Key))
if err != nil { if err != nil {
res.Close()
return err return err
} }
...@@ -89,6 +91,7 @@ func Move(oldPath string, newPath string, out io.Writer) error { ...@@ -89,6 +91,7 @@ func Move(oldPath string, newPath string, out io.Writer) error {
fmt.Fprintf(out, "\r%d keys so far", count) fmt.Fprintf(out, "\r%d keys so far", count)
} }
} }
res.Close()
if out != nil { if out != nil {
fmt.Fprintf(out, "\nCleaning Up...\n") fmt.Fprintf(out, "\nCleaning Up...\n")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment