mirror of
https://github.com/versity/versitygw.git
synced 2026-09-22 16:04:15 +00:00
fix: object verson mtime
This commit is contained in:
@@ -1166,8 +1166,18 @@ func (p *Posix) createObjVersion(bucket, key string, size int64, acc auth.Accoun
|
||||
}
|
||||
defer f.cleanup()
|
||||
|
||||
// Keeps original time
|
||||
srcInfo, _ := sf.Stat()
|
||||
beforeMTime := srcInfo.ModTime()
|
||||
|
||||
// Prioritize copy_file_range for internal file-to-file version copies.
|
||||
_, err = io.Copy(f.File(), sf)
|
||||
|
||||
err = os.Chtimes(f.File().Name(), time.Now(), beforeMTime)
|
||||
if err != nil {
|
||||
return versionPath, err
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return versionPath, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user