Merge pull request #1298 from song-zhang/master

add fsync option for benchmark
This commit is contained in:
Chris Lu
2020-04-30 20:16:42 -07:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ type FilePart struct {
Ttl string
Server string //this comes from assign result
Fid string //this comes from assign result, but customizable
Fsync bool
}
type SubmitResult struct {
@@ -116,6 +117,9 @@ func (fi FilePart) Upload(maxMB int, master string, usePublicUrl bool, jwt secur
if fi.ModTime != 0 {
fileUrl += "?ts=" + strconv.Itoa(int(fi.ModTime))
}
if fi.Fsync {
fileUrl += "?fsync=true"
}
if closer, ok := fi.Reader.(io.Closer); ok {
defer closer.Close()
}