aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs_write.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/filesys/wfs_write.go')
-rw-r--r--weed/filesys/wfs_write.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/filesys/wfs_write.go b/weed/filesys/wfs_write.go
index 3d08cb5e2..61a463e88 100644
--- a/weed/filesys/wfs_write.go
+++ b/weed/filesys/wfs_write.go
@@ -13,7 +13,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/util"
)
-func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath, writeOnly bool) filer.SaveDataAsChunkFunctionType {
+func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFunctionType {
return func(reader io.Reader, filename string, offset int64) (chunk *filer_pb.FileChunk, collection, replication string, err error) {
var fileId, host string
@@ -74,7 +74,7 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath, writeOnly bool) filer.Sa
return nil, "", "", fmt.Errorf("upload result: %v", uploadResult.Error)
}
- if !writeOnly {
+ if offset == 0 {
wfs.chunkCache.SetChunk(fileId, data)
}