diff options
| author | chrislu <chris.lu@gmail.com> | 2021-12-20 01:11:43 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2021-12-20 01:11:43 -0800 |
| commit | 4fd29dad868916d39d27b6d4a5184e73cc254ebb (patch) | |
| tree | 475dcda39c5f53316cfe7d0b410598659ec717e4 /weed/filesys/wfs_write.go | |
| parent | bc96682760f5fbbb198210cdc7354d4451906ed2 (diff) | |
| download | seaweedfs-4fd29dad868916d39d27b6d4a5184e73cc254ebb.tar.xz seaweedfs-4fd29dad868916d39d27b6d4a5184e73cc254ebb.zip | |
remove writeOnly flag
Diffstat (limited to 'weed/filesys/wfs_write.go')
| -rw-r--r-- | weed/filesys/wfs_write.go | 4 |
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) } |
