Donut cp explicitly issue a Close() on DonutWriter
This commit is contained in:
@@ -41,6 +41,7 @@ func doDonutCPCmd(c *cli.Context) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
reader.Close()
|
||||
}
|
||||
case urlArg1.Scheme == "" && urlArg2.Scheme != "":
|
||||
st, stErr := os.Stat(urlArg1.Path)
|
||||
@@ -62,6 +63,7 @@ func doDonutCPCmd(c *cli.Context) {
|
||||
panic(err)
|
||||
}
|
||||
io.Copy(writer, reader)
|
||||
writer.Close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ func (d donutFileWriter) Close() error {
|
||||
if d.err != nil {
|
||||
return d.err
|
||||
}
|
||||
println("i am here")
|
||||
metadata, _ := json.Marshal(d.metadata)
|
||||
ioutil.WriteFile(path.Join(d.root, "metadata.json"), metadata, 0600)
|
||||
donutMetadata, _ := json.Marshal(d.donutMetadata)
|
||||
|
||||
@@ -2,12 +2,13 @@ package donut
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
|
||||
"github.com/minio-io/minio/pkg/encoding/erasure"
|
||||
"github.com/minio-io/minio/pkg/utils/crypto/sha512"
|
||||
"github.com/minio-io/minio/pkg/utils/split"
|
||||
@@ -113,7 +114,6 @@ func erasureGoroutine(r *io.PipeReader, eWriter erasureWriter, isClosed chan<- b
|
||||
if nodeWriter != nil {
|
||||
nodeWriter.SetMetadata(eWriter.metadata)
|
||||
nodeWriter.SetDonutMetadata(metadata)
|
||||
println("I am here")
|
||||
nodeWriter.Close()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user