aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-09-22 22:12:21 -0700
committerChris Lu <chris.lu@gmail.com>2018-09-22 22:12:21 -0700
commit7d6b2a4740c32c3a07a4ce4204da2debee371bcd (patch)
treed60d69c2ed0deea37a63afeabae516551cb090c8 /weed/command
parent420f0683764ce97080ad6fb7dec4df3aa75480bc (diff)
downloadseaweedfs-7d6b2a4740c32c3a07a4ce4204da2debee371bcd.tar.xz
seaweedfs-7d6b2a4740c32c3a07a4ce4204da2debee371bcd.zip
add ETag to upload results and chunks
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/filer_copy.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go
index 218abf645..d7b474628 100644
--- a/weed/command/filer_copy.go
+++ b/weed/command/filer_copy.go
@@ -201,6 +201,7 @@ func uploadFileAsOne(filerAddress, filerGrpcAddress string, urlFolder string, f
Offset: 0,
Size: uint64(uploadResult.Size),
Mtime: time.Now().UnixNano(),
+ ETag: uploadResult.ETag,
})
fmt.Printf("copied %s => http://%s%s%s\n", fileName, filerAddress, urlFolder, fileName)
@@ -278,6 +279,7 @@ func uploadFileInChunks(filerAddress, filerGrpcAddress string, urlFolder string,
Offset: i * chunkSize,
Size: uint64(uploadResult.Size),
Mtime: time.Now().UnixNano(),
+ ETag: uploadResult.ETag,
})
fmt.Printf("uploaded %s-%d to %s [%d,%d)\n", fileName, i+1, targetUrl, i*chunkSize, i*chunkSize+int64(uploadResult.Size))
}