mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-15 20:06:19 +08:00
1. ensure replicated file has the same timestamp
2. upload can specify modified time by &ts=... 3. correctly return code 304
This commit is contained in:
@@ -66,7 +66,12 @@ func upload(filename string, server string, fid string) (int, error) {
|
||||
debug("Failed to open file:", filename)
|
||||
return 0, err
|
||||
}
|
||||
ret, e := operation.Upload("http://"+server+"/"+fid, path.Base(filename), fh)
|
||||
fi, fiErr := fh.Stat()
|
||||
if fiErr!=nil {
|
||||
debug("Failed to stat file:", filename)
|
||||
return 0, fiErr
|
||||
}
|
||||
ret, e := operation.Upload("http://"+server+"/"+fid+"?ts="+strconv.Itoa(int(fi.ModTime().Unix()) ), path.Base(filename), fh)
|
||||
if e != nil {
|
||||
return 0, e
|
||||
}
|
||||
|
Reference in New Issue
Block a user