提交 636f776b 编写于 作者: D Davies Liu

don't buffer them in disk if copy from or to disk

上级 04e69e79
......@@ -9,6 +9,7 @@ import (
"io/ioutil"
"os"
"regexp"
"strings"
"sync"
"sync/atomic"
"time"
......@@ -96,6 +97,17 @@ func copyObject(src, dst object.ObjectStorage, obj *object.Object) error {
<-concurrent
}()
key := obj.Key
if strings.HasPrefix(src.String(), "file://") || strings.HasPrefix(dst.String(), "file://") {
in, e := src.Get(key, 0, -1)
if e != nil {
if src.Exists(key) != nil {
return nil
}
return e
}
defer in.Close()
return dst.Put(key, in)
}
firstBlock := -1
if obj.Size > maxBlock {
firstBlock = maxBlock
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册